tags:

views:

31

answers:

2

How can i toggle a div closed using jquery ie hide the box below (close it) if #something is present in the URL http://www.mydomain.co.uk/index.php#something

<div id="feature">content</div>
A: 

By checking the window.location.hash.

if (window.location.hash == "something") $("#featured").hide();
Jonathan Sampson
+1  A: 
$(function() {
    if(window.location.hash.indexOf('something') !== -1) {
        $('div#feature').hide();
    }
});
Tatu Ulmanen
wicked, so easy :@)
Andy