开发者

FadeIn the Localstorage Value

I have few tabs which their ID is the Item in localstorage which I'm trying to fadeIn.

Tab fadeIn with: $('Tab1').show(); Now, I've set the value of 'Tabvalue' to 'Tab1' and I tried to fade it in as follow: $("#" + $(localStorage.getItem("TabValue"))).Show(); b开发者_运维技巧ut it doesn't seem to work.

Does anyone know how can I solve this problem?


Try this:

 $("#" + localStorage.getItem("TabValue")).show();

the localStorage value doesn't need to be wrapped in $() as it's a string, gets converted to an jQuery object, and back to a (mostly useless) string. Also, Show() needs to be show().

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜