• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug Customization Navbar that shows which link is the current page

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #130 (Hot or Cold), Memol..

The next Dgrin Challenge DSS #131 (Music) is open for entries through June 24th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Page 9  of  25
Old Mar-02-2010, 05:04 PM
#161
jwvanderbeck is offline jwvanderbeck
Big grins
Quote:
Originally Posted by jfriend
I can't tell exactly what you're trying to do, but you can try this navbar CSS (lines changed are in red) to at least get the CSS rules firing:
Just trying to get my existing navbar to work with your script so I can have the current page show up selected :)

Thanks, the changes you gave me got it at least working, though my "current" button seems to be getting cut off a bit. I probably just need to play with my CSS for it as bit.
Old Mar-02-2010, 06:05 PM
#162
jwvanderbeck is offline jwvanderbeck
Big grins
Quote:
Originally Posted by jwvanderbeck
Just trying to get my existing navbar to work with your script so I can have the current page show up selected :)

Thanks, the changes you gave me got it at least working, though my "current" button seems to be getting cut off a bit. I probably just need to play with my CSS for it as bit.
grr.. Well it displays the different style on the currently selected page, but for the life of me I can't figure out how to fix the display of that style. If you look at it, it properly has the right border but not the left. You can see the proper left and right borders in the mouse over style. The selected style is the same image, just a different color yet it won't display properly :(
Old Mar-02-2010, 06:24 PM
#163
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by jwvanderbeck
grr.. Well it displays the different style on the currently selected page, but for the life of me I can't figure out how to fix the display of that style. If you look at it, it properly has the right border but not the left. You can see the proper left and right borders in the mouse over style. The selected style is the same image, just a different color yet it won't display properly :(
Again, I don't know exactly what you're trying to do or how it's supposed to work, but the background image you're using is 260px wide so that's how far apart the corners are (way further than your buttons are wide). Since you're specifying the top right position, you're only seeing the right edge.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Mar-02-2010, 06:40 PM
#164
jwvanderbeck is offline jwvanderbeck
Big grins
Quote:
Originally Posted by jfriend
Again, I don't know exactly what you're trying to do or how it's supposed to work, but the background image you're using is 260px wide so that's how far apart the corners are (way further than your buttons are wide). Since you're specifying the top right position, you're only seeing the right edge.
I'm just trying to get the #2 menu from here: http://www.cssplay.co.uk/menus/pro_horizontal.html working like it was intended.

I'm just hacking my way along though :( The image you mention is the same as the mouseover one and that one works fine.
Old Mar-02-2010, 06:55 PM
#165
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by jwvanderbeck
I'm just trying to get the #2 menu from here: http://www.cssplay.co.uk/menus/pro_horizontal.html working like it was intended.

I'm just hacking my way along though :( The image you mention is the same as the mouseover one and that one works fine.
First, please add your site link to your dgrin signature so it's in every post. Every time I want to answer you, I have to scroll back in the thread (now on a previous page) to find your site link.

Just so you know, the two ".menu2 .navCurrentPage a:hover" CSS rules are doing nothing. Remove them and nothing changes. So, I don't think you want the highlight rules to work the same way as those.

I figured out how the rules work. Change your navbar CSS to this:

Code:
/*Credits: CSSpplay */
/*URL: http://www.cssplay.co.uk/menus/pro_two */
.menu2 {padding:0 0 0 32px; margin:0; list-style:none; height:35px; background:#fff url(http://www.landscapesandcityscapes.com/photos/801074246_Wf4ae-X3.gif); position:relative; border:1px solid #000; border-width:0 1px; border-bottom:1px solid #444; !important;}
.menu2 li {float:left; !important;}
.menu2 li a {display:block; float:left; height:35px; line-height:35px; color:#aaa; text-decoration:none; font-size:11px; font-family:arial, verdana, sans-serif; font-weight:bold; text-align:center; padding:0 0 0 8px; cursor:pointer;}
.menu2 li a b {float:left; display:block; padding:0 16px 0 8px;}
.menu2 a.navCurrentPage b {color:#fff; background:url(http://www.landscapesandcityscapes.com/photos/801074251_vDnqa-X3.gif) no-repeat top right !important;}
.menu2 a.navCurrentPage {color:#fff; background:url(http://www.landscapesandcityscapes.com/photos/801074251_vDnqa-X3.gif) no-repeat top left !important;}
.menu2 li a:hover {color:#fff; background:#000 url(http://www.landscapesandcityscapes.com/photos/801074253_Vafxf-X3.gif);}
.menu2 li a:hover b {background:url(http://www.landscapesandcityscapes.com/photos/801074253_Vafxf-X3.gif) no-repeat right top;}
They have two copies of the background image. One is a background on the <a> tag and it top right position with 10px cut off on the left edge. The other is a background on the <b> tag and is top left position, giving you both edges.

FYI, none of your !important statements were working so I removed the ones that were not needed and fixed the two that were. You should look up on Google how !important works in CSS. It goes before the ; at the end of a particular rule, not after it.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Mar-02-2010, 07:26 PM
#166
jwvanderbeck is offline jwvanderbeck
Big grins
Quote:
Originally Posted by jfriend
First, please add your site link to your dgrin signature so it's in every post. Every time I want to answer you, I have to scroll back in the thread (now on a previous page) to find your site link.

Just so you know, the two ".menu2 .navCurrentPage a:hover" CSS rules are doing nothing. Remove them and nothing changes. So, I don't think you want the highlight rules to work the same way as those.

I figured out how the rules work. Change your navbar CSS to this:

Code:
/*Credits: CSSpplay */
/*URL: http://www.cssplay.co.uk/menus/pro_two */
.menu2 {padding:0 0 0 32px; margin:0; list-style:none; height:35px; background:#fff url(http://www.landscapesandcityscapes.com/photos/801074246_Wf4ae-X3.gif); position:relative; border:1px solid #000; border-width:0 1px; border-bottom:1px solid #444; !important;}
.menu2 li {float:left; !important;}
.menu2 li a {display:block; float:left; height:35px; line-height:35px; color:#aaa; text-decoration:none; font-size:11px; font-family:arial, verdana, sans-serif; font-weight:bold; text-align:center; padding:0 0 0 8px; cursor:pointer;}
.menu2 li a b {float:left; display:block; padding:0 16px 0 8px;}
.menu2 a.navCurrentPage b {color:#fff; background:url(http://www.landscapesandcityscapes.com/photos/801074251_vDnqa-X3.gif) no-repeat top right !important;}
.menu2 a.navCurrentPage {color:#fff; background:url(http://www.landscapesandcityscapes.com/photos/801074251_vDnqa-X3.gif) no-repeat top left !important;}
.menu2 li a:hover {color:#fff; background:#000 url(http://www.landscapesandcityscapes.com/photos/801074253_Vafxf-X3.gif);}
.menu2 li a:hover b {background:url(http://www.landscapesandcityscapes.com/photos/801074253_Vafxf-X3.gif) no-repeat right top;}
They have two copies of the background image. One is a background on the <a> tag and it top right position with 10px cut off on the left edge. The other is a background on the <b> tag and is top left position, giving you both edges.

FYI, none of your !important statements were working so I removed the ones that were not needed and fixed the two that were. You should look up on Google how !important works in CSS. It goes before the ; at the end of a particular rule, not after it.
Thank you SO much John. Both for your patience, and for your help. It works perfectly now. Sorry about the site link. I didn't think about it. I haven't gotten around to adding it into my signature yet since i'm still building the site up.
Old Apr-19-2010, 07:47 PM
#167
aarbiser is offline aarbiser
Big grins
Yellow line not working
Hi,

I have copied the both of the scripts and all i want is the yellow line on the top and bottom of the words like yours. Nothing seems to show up and was wondering if you could have a look and help if you can.

Many thank

Assaf

My website is

www.arbiser.com
Old Apr-20-2010, 05:54 PM
#168
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by aarbiser
Hi,

I have copied the both of the scripts and all i want is the yellow line on the top and bottom of the words like yours. Nothing seems to show up and was wondering if you could have a look and help if you can.

Many thank

Assaf

My website is

www.arbiser.com
You got the javascript correct, but not the CSS. Change your CSS to this:

Code:
/* highlight individual menu items when their page is current */
#customNav .navCurrentPage {background: none; border-bottom: 1px solid #CCCC00; border-top: 1px solid #CCCC00;}
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Apr-20-2010, 06:19 PM
#169
aarbiser is offline aarbiser
Big grins
thanks, That is great. It works well except on weddings and celebrations and the pro bono page.
Any other suggestions would be great.

Thanks

Assaf

www.arbiser.com
Old Apr-20-2010, 06:27 PM
#170
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by aarbiser
thanks, That is great. It works well except on weddings and celebrations and the pro bono page.
Any other suggestions would be great.

Thanks

Assaf

www.arbiser.com
For those two pages, you have to change the links in your navbar to match the resulting URL that shows in the browser because that's how the code knows you're on that page so it can highlight the navbar for that page. You have spaces in the URL in the navbar, but Smugmug puts dashes in the URL in the browser. Change your navbar to use the dashes.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Apr-20-2010, 08:37 PM
#171
aarbiser is offline aarbiser
Big grins
All done. Thank you for all your help
Old Apr-24-2010, 05:23 PM
#172
Fritz is offline Fritz
Beyond a Grin...Smiling
Firefox working great / IE 8 appears buggy
John,

This is a great idea. I like what you've done here. My code works perfectly in Firefox and a little slow in IE. If you use IE, click on Home, Galleries or Search and move the mouse away quickly, the bars don't show. When you move the mouse back, it lights the bars. I've tried moving the code around but same results. Again, Firefox works all the time.

Any thoughts? http://www.brucefratto.com/mapGallery

Thanks for sharing your code.

Bruce
Old Apr-24-2010, 05:30 PM
#173
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by Fritz
John,

This is a great idea. I like what you've done here. My code works perfectly in Firefox and a little slow in IE. If you use IE, click on Home, Galleries or Search and move the mouse away quickly, the bars don't show. When you move the mouse back, it lights the bars. I've tried moving the code around but same results. Again, Firefox works all the time.

Any thoughts? http://www.brucefratto.com/mapGallery

Thanks for sharing your code.

Bruce
I don't see any issues with the code. It always highlights for me when the mouse isn't over the selected item (you have the mouse item displaying something different). I do see a javascript error that could be interfering.

Remove the comma at the end of this line:

Code:
flashRequiredHTML: "Please install <b>Adobe Flash</b> so you can see my slideshow.  Click on the Guest Book Menu, then on the Adobe hotlink in the Notes section.",
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Apr-24-2010, 05:50 PM
#174
Fritz is offline Fritz
Beyond a Grin...Smiling
Quote:
Originally Posted by jfriend
I don't see any issues with the code. It always highlights for me when the mouse isn't over the selected item (you have the mouse item displaying something different). I do see a javascript error that could be interfering.

Remove the comma at the end of this line:

Code:
flashRequiredHTML: "Please install <b>Adobe Flash</b> so you can see my slideshow.  Click on the Guest Book Menu, then on the Adobe hotlink in the Notes section.",
I took out the comma. Same results. Also have the same results from my laptop. Appears to be related to the larger page loads. Blog works fine also. If I keep the mouse on the navigation bar for 2 sec. it works. . . strange.

Thanks for looking.
Old Apr-24-2010, 05:55 PM
#175
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by Fritz
I took out the comma. Same results. Also have the same results from my laptop. Appears to be related to the larger page loads. Blog works fine also. If I keep the mouse on the navigation bar for 2 sec. it works. . . strange.

Thanks for looking.
I don't know. Works fine here so I can't see the problem to offer any ideas.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old May-02-2010, 11:59 AM
#176
MRagon is offline MRagon
Beginner grinner
Can't make the double yellow line work....
I've beat my head against the wall for 2 days trying to make my navbar button show the current page. The code I currently "thought" I had used was for the double yellow line. I can't get it to work so I'm giving in and asking for help. Thanks for any suggestion!
__________________
MRagon
http://www.ragonfoto.com
Old May-02-2010, 12:07 PM
#177
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by MRagon View Post
I've beat my head against the wall for 2 days trying to make my navbar button show the current page. The code I currently "thought" I had used was for the double yellow line. I can't get it to work so I'm giving in and asking for help. Thanks for any suggestion!
Change your CSS to this:

/* highlight individual menu items when their page is current */
#customNav .navCurrentPage {background: none; border-bottom: 1px solid #CCCC00; border-top: 1px solid #CCCC00;}
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old May-02-2010, 01:35 PM
#178
MRagon is offline MRagon
Beginner grinner
Quote:
Originally Posted by jfriend View Post
Change your CSS to this:

/* highlight individual menu items when their page is current */
#customNav .navCurrentPage {background: none; border-bottom: 1px solid #CCCC00; border-top: 1px solid #CCCC00;}
Thank you!!! What a difference a small difference can make. I really appreciate the help.
__________________
MRagon
http://www.ragonfoto.com
Old Jun-23-2010, 08:32 PM
#179
blzrdphoto is offline blzrdphoto
Big grins
I installed the code i believe the correct way. It seems to work with the home page, portfolio, Galleries pages (the photographer page is still under construction) but as soon as you go into a gallery or category it highlights "contact." I am not sure what I am doing wrong or how to fix it....


Quote:
What a difference a small difference can make. I really appreciate the help.
I can second this comment.
__________________
www.blzrdphoto.com
Old Jun-26-2010, 09:00 AM
#180
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by blzrdphoto View Post
I installed the code i believe the correct way. It seems to work with the home page, portfolio, Galleries pages (the photographer page is still under construction) but as soon as you go into a gallery or category it highlights "contact." I am not sure what I am doing wrong or how to fix it....




I can second this comment.
The problem is caused by the link in your contact navbar entry which is just href="#". If there's some way you can change that, the issue would go away. If not, then the script will have to be modified to somehow detect a fake link like that.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Page 9  of  25
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump