开发者

Toggle a div closed if a #something is present in a URL

开发者 https://www.devze.com 2022-12-13 15:12 出处:网络
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#some开发者_运维百科thing

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#some开发者_运维百科thing

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


$(function() {
    if(window.location.hash.indexOf('something') !== -1) {
        $('div#feature').hide();
    }
});


By checking the window.location.hash.

if (window.location.hash == "something") $("#featured").hide();
0

精彩评论

暂无评论...
验证码 换一张
取 消