|
|
Thread Tools | Display Modes |
|
#61
|
||
|
Scripting dude-volunteer
|
Quote:
Code:
/* highlight individual menu items when their page is current */
#navcontainer .navCurrentPage {background: none; border-bottom: 1px solid #CCCC00; border-top: 1px solid #CCCC00;}
Code:
/* highlight individual menu items when their page is current */
#customNavContainer .navCurrentPage {
border-bottom: 1px solid #DDDD00;
border-top: 1px solid #DDDD00;
}
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#62
|
|
|
Big grins
|
Works exactly as advertised!! Thank you so much! |
|
|
|
|
#63
|
||
|
Keep Thou my Feet
|
Yikes! I Broke my site trying the new navbar highlight cuteness!
Quote:
I really like the "Professional #3" Navbar that's at this link: http://www.cssplay.co.uk/menus/pro_horizontal.html but haven't downloaded the file, & maybe now's not the time to try it. Probably should have done that first. I don't know whether that one works with dropdowns, either, & I'll plan to add a few. Ok, my present CSS: YE.onContentReady("navcontainer", function () #navcontainer ul { margin: 0; padding: 0; list-style-type: none; text-align: center; } #navcontainer ul li { display: inline; } #navcontainer ul li a { text-decoration: none; padding: .2em 1em; color: #fff; background-color: #336633; font-size: 9pt !important; line-height: 26px; } /* highlight individual menu items when their page is current */ #navcontainer ul li a:hover, #navcontainer .navCurrentPage { color: #fff; background-color: #33CC66; }
__________________
Anna Lisa Yoder's Images - http://winsomeworks.com or http://annalisa.smugmug.com Scribbles at: http://winsomeworks.blogspot.com ... Handmade Photo Notecards http://winsomeworks.etsy.com My Folk Music Group (some free mp3s!) http://daybreakfolk.com |
|
|
|
||
|
#64
|
|
|
Keep Thou my Feet
|
Site back but no highlighting
Oh brother. In ref. to my post below...I just figured out what I'd done to make the site look like Picasso with ugly Morning Face, or some other kind of Gary Larson cartoon. I'd wrongly added the whole "YE..." line to CSS, not understanding that it was already in the Java box & that I was supposed to just edit it there! So-- now my site's back, but for some reason, no highlighting is happening. The parrot at my work always squawks accusingly when I come in-- "WHA'd you do??!" so that's what I'm asking myself now. Do you see the error? I still like this: http://www.cssplay.co.uk/menus/pro_horizontal.html (#3, the green one) Do you think it's hard to do?
__________________
Anna Lisa Yoder's Images - http://winsomeworks.com or http://annalisa.smugmug.com Scribbles at: http://winsomeworks.blogspot.com ... Handmade Photo Notecards http://winsomeworks.etsy.com My Folk Music Group (some free mp3s!) http://daybreakfolk.com |
|
|
|
|
#65
|
||
|
Scripting dude-volunteer
|
Quote:
OK, on this one it looks like from your second post (the first one had me confused) that you want to know why your navbar highlighting isn't working. First, you need to clean up a javascript error. This code is causing an error on your homepage. You need to remove it until you can find a version that doesn't cause an error. Code:
// Facebook button
var pos = window.document.URL.indexOf("gallery");
if ( SM) {
var thisURL = webServer + "/gallery/" + AlbumID + "_" + AlbumKey + "/1/" + ImageID + "_" + ImageKey ;
SM.buttons.FacebookButton = new YAHOO.widget.Button({
id: 'Share on Facebook',
label: 'Share on Facebook',
container: 'altViews',
type: 'link',
href: 'http://www.facebook.com/share.php?u='+thisURL+'&t=SmugMug+Image',
target: '_blank',
className: 'sm-button sm-button-small facebookButton glyphButton menuButton share_button'
});
}
Then, this line of code in your bottom javascript is case sensitive. "NavContainer" must be "navcontainer" exactly how you have it in your own HTML: YE.onContentReady("navcontainer", function () After you fix those, we can see what else needs fixing.
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#66
|
|
|
Keep Thou my Feet
|
Navbar current page highlighting works great now!
I'm very sorry about that, John-- I should have edited the first post instead, or made it more clear in the 2nd one that the first was now sorta obsolete. Yes, I get too bogged down in the details-- it's a constant battle for me. Good news is: with the exact changes you suggested, the tabs are highlighting perfectly on my navbar-- everything with that works fantastic! I think this is a big help to viewers-- and to me, too. Thank you for working on it!! Maybe at some point you can add this particular hover-highlighting to the original post as one of the options to choose-- it's a good one!
Since many folks have a simple navbar like mine, a note to them: The code I used, a couple posts down, will keep your whole tab (such as "home" or "guestbook") highlighted when you're on that page or section... instead of just the text. It essentially keeps that tab in hover mode while you're there. I mistakenly used caps because I saw them other places in the javascript-- don't do that! Copy John's script exactly! John, right after I installed that Facebook button, I found out Smug had installed one in the "share" menu anyway, so it's a little redundant now & I hadn't gotten it removed. It's all removed now. I may have found the error in it though, at least in the part of it that was in my CSS box. There was a missing space before a link. I'll let the OP know. From what you were saying though, perhaps there are also errors in the Javascript part? I'd found this addition in a fairly recent thread here, but I guess it's a cautionary tale.
__________________
Anna Lisa Yoder's Images - http://winsomeworks.com or http://annalisa.smugmug.com Scribbles at: http://winsomeworks.blogspot.com ... Handmade Photo Notecards http://winsomeworks.etsy.com My Folk Music Group (some free mp3s!) http://daybreakfolk.com |
|
|
|
|
#67
|
|
|
Big grins
|
Is there a way to force the highlighting on one nav-bar-link when the user is in one category and its children that is not the one the nav-bar-link directly points to?
More specifically: on my site http://comapedrosa.smugmug.com the "personal" link in the nav-bar points to this gallery called "Personal": URL edited out But that gallery has a link to the category also called "Personal": URL edited out Is it possible to include some code so that the link "Personal" in the nav-bar is highlighted when the user is in the category "Personal" and its galleries, although it doesn't directly point there? Thank you! Last edited by Coma Pedrosa; Jun-10-2012 at 08:57 PM. |
|
|
|
|
#68
|
||
|
Scripting dude-volunteer
|
Quote:
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#69
|
|
|
Big grins
|
It's from the Easy Customizer.
|
|
|
|
|
#70
|
||
|
Scripting dude-volunteer
|
Quote:
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#71
|
|
|
Big grins
|
As always, thank you John for your prompt and detailed answer.
Does that mean i'm out of luck? |
|
|
|
|
#72
|
||
|
Scripting dude-volunteer
|
Quote:
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#73
|
|
|
Big grins
|
Great, thank you!
|
|
|
|
|
#74
|
||
|
Scripting dude-volunteer
|
Quote:
Code:
YE.onContentReady("customNavContainer", function()
{
var re = /\/Personal\//;
var links = Sizzle("li a", this);
for (var i = 0; i < links.length; i++)
{
if (re.test(links[i].href))
{
YD.addClass(links[i], "personalNavLink");
YD.addClass(links[i].parentNode, "personalNavLinkParent");
break;
}
}
});
/* highlight individual menu items when their page is current */ #customNavContainer .navCurrentPage, .category_Personal .personalNavLink {border-bottom: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF;}
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#75
|
|
|
Big grins
|
John,This works like a sharm. I'm in heaven! And i don't know how to thank you! I promise no more requests for this week!!!!
|
|
|
|
|
#76
|
|
|
Big grins
|
Link highlighting pbs in IE8
Hi,
The general highlighting works perfectly in Chrome, but in IE8 it has a rather random behavior. I've added "!important" in the CSS, but that hasn't helped at all. First the links where not highlighted at all. On the second pass, only the bottom line appeared in *some* links. Now it seems to only highlight the links when the user is in a gallery as opposed to a category. This is puzzling... Is there anything you suggest i do to get a more robust and consistent behavior in IE8? Thank you!! Coma |
|
|
|
|
#77
|
||
|
Scripting dude-volunteer
|
Quote:
I don't know why it's having troubles in IE. It has to do only with the CSS and your particular navbar and IE not thinking there's room for the border and somehow clipping it off, nothing to do with the script itself. You can try changing to this: Code:
/* highlight individual menu items when their page is current */
#customNavContainer .navCurrentPageParent, .category_Personal .personalNavLink {border-bottom: 1px solid #FFFFFF !important; border-top: 1px solid #FFFFFF !important;}
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#78
|
|
|
Big grins
|
Thank you so much for the explanation and solution John. Unfortunately, this didn't change anything to the behavior in IE8. How do others get it to work in IE8???
Thx!! |
|
|
|
|
#79
|
||
|
Scripting dude-volunteer
|
Quote:
#customNav a {line-height: 2;}
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#80
|
|
|
Big grins
|
M a n y o u a r e g o o d !
|
|
|
|
| Tell The World! | |
| Thread Tools | |
| Display Modes | |
|
|