Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Screen name:
x3msnake
x3msnake's Profile
1
Posts
3
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Ideas
Problems
Expanded view
List view
Private Message
How to - Set Store and Get Variables????
[6Replies]
15-Aug-2011 08:33 AM
Forum:
Getting Started
Greetings
I'm trying to write a code to hide a element and remember which elemnt was hidden when you change page.
The site is this www.arestaviva.com
the problematic code goes like this
<!-- Change the css dinamicly with JQuery-->
<div id="langctrl">
<button id="PT" class="language">PT</button>
<button id="UK" class="language">UK</button>
<script>
$(document).ready(function(){ //check if the page has loaded
$(window).one("load", function(){
// set default lang - run once
ctlang = "PT";
});
$(window).load(function(){
// if user clicked PT
if (ctlang == "PT") {
$("body").find("#alternative").hide("fast");
alert(ctlang);
}
// if user clicked UK
else if (ctlang == "UK"){
$("body").find("primary").hide("fast");
alert(ctlang);
}
});
// Get button ID'S and apply function to hide/show lang by respective elements.
$("#PT").click(function () {
$("body").find("#alternative").hide("fast");
$("body").find("#primary").show("fast");
ctlang = "PT";
alert(ctlang);
//tell the browser UK is hidden
});
$("#UK").click(function () {
$("body").find("#alternative").show("fast");
$("body").find("#primary").hide("fast");
ctlang = "UK";
alert(ctlang);
//tell the browser PT is hidden
});
}); //()ready
</script>
</div> <!-- #langctrl -->
Problem is that once one navigates to the next page the variable is reset and lost :|
I know I'm doing something wrong but my queries on google have not proved fruitful in solving this one :\
Can you guys help me?
Best Regrads
X3msnake
3skfreelance.org
«Prev
Next »
Moderate user : x3msnake
Forum