Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you disable jquery ui icons

Is there a way to disable the icons in jquery? For example I am using ui-icon-circle-triangle-w and ui-icon-circle-triangle-e for "prev/next" and I would like to disable "prev" when at the beginning of the list and next when at the end etc.

like image 387
Tim Martin Avatar asked Aug 02 '11 05:08

Tim Martin


People also ask

How to disable icon in jQuery?

Here is a trick to work on a tags to have disabled . Add a class disabled to the a tag and check the on click functions. just return false in case if you don't want to allow clicks when the clicked a tag has a disabled class. Its preferred to call the e.

How do I disable UI Datepicker trigger?

Datepicker has a built-in disable method for this you can use, which also disables the text input, like this: $("#datepicker"). datepicker("disable");


2 Answers

I guess this should have been obvious but it wasn't in the main documentation on how to use the icons. You just add the class "ui-state-disabled" to the element. So for example to do it thru javascript you might do:

$('').addClass('ui-state-disabled');

like image 111
Tim Martin Avatar answered Nov 15 '22 09:11

Tim Martin


You can set .ui-icon to not display, which should also hide the icons. You may or may not need the "!important" part.

.ui-icon { display: none !important; }
like image 35
producerism Avatar answered Nov 15 '22 11:11

producerism