开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜