Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Toggle class not work when apply on fixed div?

I am working toggle class .Actually I want to toggle something (a div ) when i click on header button (fourth button) ?It is not working.It is not toggling ? why? http://jsfiddle.net/ravi1989/3xbGW/11/I want to toggle this contend..? why it is not toggling?
<div class="ui-grid-c" id="searchbar" style="display: none" class="searchContend_h">
<input name="text-12" id="text-12" value="" type="text" autocorrect="off" class="searchbox"> <a href="#" data-role="button" data-corners="false" data-inline="true" class="search">Search</a>
<a href="#" data-role="button" data-corners="false" data-inline="true" id="next" class="searchNext" disabled>Next</a>
<a href="#" data-role="button" data-corners="false" data-inline="true" id="prev" class="searchPrev" disabled>Previous</a>

Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Toggle class not work when apply on fixed div?

To toggle a class on a DOM element, you can use the following HTML5 APIs (i.e. toggle):



Is the issue you are seeing that the header button does not execute its code or that the class is not being toggled? I might recommend a simpler sample as a starting point; try to see if you can toggle the text of a paragraph from black to red when clicking a button.


The fundamental usage is the same and it will be easier to test than a full-fledged jQuery sample.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.