开发者

Click a link on a home page and have it open an accordion other then default actice

Hi I need to be able to click a special menu link on the homepage and have it open a page with an accordion open to a different section other then the one that is normally active (0) when you visit the page from the default (different) menu li开发者_StackOverflow中文版nk. I am pretty new to jQuery but I think I can follow proposed solutions.

Thanks!


What I can think of, is that you can send a var via your URL and GET it in the target page, and depending on the value of this var, you open/close whatever accordion section you want. For a javascript function to get values, you can do something like this:

function getUrlVars() {
var map = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
    map[key] = value;
});
return map;
}

Source

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜