Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove uniform function on a specific select?

i am using uniform js for changing the background images of checkbox, radio buttons, select box. For this i include jquery file, uniform library js file and another thing is a function of uniform js for initializing the function as

$(function(){
   $("input, select, textarea, button").uniform();
});

Here i got one issue, i want to clear this function at the specific portion of the content where i do not want uniform function. then what procedure do i adopt for solving my problem?

I do not have jsfiddle code for this code. If you need it i will let you know.

like image 864
Hassaan Avatar asked Dec 16 '22 13:12

Hassaan


2 Answers

Just use the .not() function and set a class on items that you wish to omit the uniform() logic.

DOM:

<!-- This gets it -->
<select>
   <option>Foo</option>
</select>

<!-- This doesn't -->
<select class="noUniform">
    <option>Bar</option>
</select>

JS:

$(function(){
   $("input, select, textarea, button").not('.noUniform').uniform();
});
like image 64
AlienWebguy Avatar answered Jan 14 '23 01:01

AlienWebguy


the attribute data-no-uniform set as "true" do the job

like image 21
fedeghe Avatar answered Jan 13 '23 23:01

fedeghe