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
Zoho Docs
Google Docs
Each Attachment size should not exceed 1MB.
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:
roberto.tremonti
roberto.tremonti's Profile
1
Posts
1
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
Use navbar buttons as toggle buttons in jQuery Mobile
[3Replies]
20-Dec-2012 06:54 AM
Forum:
jQuery Mobile
Hi guys,
I'm trying to use
footer navbar buttons
as toggle buttons in jQuery Mobile 1.2.0, but I have a problem on Safari Mobile.
This is the HTML code for my buttons.
<div data-role="navbar" class="navbar" data-grid="b">
<ul>
<li><a href="#" id="navbar-1" data-icon="custom">Navbar 1</a></li>
<li><a href="#" id="navbar-2" data-icon="custom">Navbar 2</a></li>
<li><a href="#" id="navbar-3" data-icon="custom">Navbar 3</a></li>
</ul>
</div>
And this is the JavaScript code I use to simulate toggle feature.
var toggle1 = false;
$("#navbar-1").on("click", function () {
if (toggle1) {
$("#navbar-1").removeClass("ui-btn-active");
}
else {
$("#navbar-1").addClass("ui-btn-active");
}
toggle1 = !toggle1;
return false;
});
[Repeat for navbar-2 and navbar-3]
This works correctly on Safari, Chrome and Firefox.
Every button is "independent" and the click action works like a toggle.
But on Safari Mobile, if I click on a button, it automatically deactivates all the other.
How do I prevent this default behaviour on Safari Mobile?
Thanks.
«Prev
Next »
Moderate user : roberto.tremonti
Forum