/ Published in: jQuery
URL: http://www.pacificshoreshb.com/bungalows/features/
The "currentFeature" is whatever div is initially viewable. The function will hide the current div and show the new one. The document ready highlights the initial item in the navigation.
Expand |
Embed | Plain Text
currentFeature = 'featuresOne'; function showFeature(whichFeature) { pound = '#'; linkType = 'Link'; fadedFeature = pound.concat(whichFeature); pwndFeature = pound.concat(currentFeature); fadedLink = fadedFeature.concat(linkType); pwndLink = pwndFeature.concat(linkType); $(pwndFeature).fadeOut(300, function() { $(fadedFeature).fadeIn(300); $(pwndLink).css("color","#000"); $(fadedLink).css("color","#EE8A1E"); }); currentFeature = whichFeature; currentLink = fadedLink; } $(document).ready(function () { $("#featuresOneLink").css("color","#EE8A1E"); });
You need to login to post a comment.
