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()
.
精彩评论