Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2010
    Posts
    72
    Thanks
    30
    Thanked 0 Times in 0 Posts

    Smile Help with Jquery Slide Toggle Fallback

    Hello there..

    I need to make some kind of fallback to my Jquery slide toggle so it is just a link/button for browsers with no java supported. Can anyone help me?

    Javascript:
    Code:
    $(document).ready(function(){
    $("#inkassobox").toggle(function(){
    $("#inkassobox").animate({'height': '280px'});
    	}, function(){
    $("#inkassobox").animate({'height': '125px'});
    	});
    $("#links").click(function(event){
    	event.stopPropagation();
    	});
    });
    http://www.shanem.dk/hornvind

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,636
    Thanks
    6
    Thanked 1,003 Times in 976 Posts
    First of all, I appreciate that you’re thinking about a fallback at all. Most people just implement technologies without thinking any further.

    Then, one thing I’m always doing right in the beginning is to add a class to the body (or html root element) using JS which serves as my hook to apply specific styles that are only seen if JS is enabled. The reverse approach (which is used by some people, too) would be to add a “no JS” class to the html and remove it with JS then. This way you can do the following with your box: If JS is not available/enabled then make it a simple CSS hover function.
    Code:
    #inkassobox:hover {height: 280px;}

  • Users who have thanked VIPStephan for this post:

    Samz3n (10-03-2012)

  • #3
    New Coder
    Join Date
    Apr 2010
    Posts
    72
    Thanks
    30
    Thanked 0 Times in 0 Posts
    Thank you very much for your appreciating

    In my case it is very important, that my site is supported by almost every browsers (with or without java, transitions etc.)

    I think I will just go with the hover effect and disable the jquery on #inkassobox
    I like it better this way! (And if I want some animation, later I can add some css3 transition to it)

    Thank you for your help Stephan


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •