Placing the new links after the original ones
|
|
Hi, I really like this script, but I have a tiny question to do: Could you make the new forum and blog links go after the original navigation links? Maybe something like an option to choose between both?
var ul = document.getElementById("navigation"), li =
document.createElement("li");
ul.insertBefore(forumlink_li, ul.getElementsByTagName("li")[0]);
ul.insertBefore(bloglink_li, ul.getElementsByTagName("li")[0]);
with var ul = document.getElementById("navigation");
ul.appendChild(bloglink_li);
ul.appendChild(forumlink_li);
I really like the script and hope you consider my suggestion. |
|
|
However strange this may seem, when I use:
When I use:
This is why I chose the insertBefore() function, originally. |
|
|
Now that is strange... In here, it is exactly the opposite, and in theory the code you use should make it as is happening to me... When I enter Now, using Have you checked if you have any special CSS in stylish that is modifying the position taken by the Weird :/ |
|
|
Good thought; you were right that my CSS in http://userstyles.org/styles/3866 is modifying the list order. Probably the absolute positioning. |
|
|
Actually, for what I read of the style, I think the problem is in
#navigation > li
{
float: right !important;
}
that inverts the order of the list (from left to right to right to left). I think the solution for who doesn't want to invert the links order but want to keep the new "Blog" and "Forum" links to the right, is to provide some switch in the script, something like: // Change the links order so they are placed on the left or on the right var LinksOnRight = true; and use different code according to it being |