Posted By

ryarwood on 06/09/11


Tagged


Versions (?)

Basic Show Hide Div for Features, Floorplans, Etc.


 / 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.

  1. currentFeature = 'featuresOne';
  2.  
  3. function showFeature(whichFeature) {
  4. pound = '#';
  5. linkType = 'Link';
  6. fadedFeature = pound.concat(whichFeature);
  7. pwndFeature = pound.concat(currentFeature);
  8. fadedLink = fadedFeature.concat(linkType);
  9. pwndLink = pwndFeature.concat(linkType);
  10.  
  11. $(pwndFeature).fadeOut(300, function() {
  12. $(fadedFeature).fadeIn(300);
  13. $(pwndLink).css("color","#000");
  14. $(fadedLink).css("color","#EE8A1E");
  15. });
  16.  
  17. currentFeature = whichFeature;
  18. currentLink = fadedLink;
  19. }
  20.  
  21. $(document).ready(function () {
  22. $("#featuresOneLink").css("color","#EE8A1E");
  23. });

Report this snippet  

You need to login to post a comment.