| Server IP : 104.26.5.103 / Your IP : 216.73.216.4 Web Server : nginx/1.27.1 System : Linux in-5 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : arabianexpress ( 1872) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v9321/leapdubai/public_html/wp-content/themes/printx/inc/js/ |
Upload File : |
jQuery(document).ready(function($) {
$('.switch_options').each(function() {
//This object
var obj = $(this);
var enb = obj.children('.switch_enable'); //cache first element, this is equal to ON
var dsb = obj.children('.switch_disable'); //cache first element, this is equal to OFF
var input = obj.children('input'); //cache the element where we must set the value
var input_val = obj.children('input').val(); //cache the element where we must set the value
/* Check selected */
if (0 == input_val) {
dsb.addClass('selected');
}
else if (1 == input_val) {
enb.addClass('selected');
}
//Action on user's click(ON)
enb.on('click', function() {
$(dsb).removeClass('selected'); //remove "selected" from other elements in this object class(OFF)
$(this).addClass('selected'); //add "selected" to the element which was just clicked in this object class(ON)
$(input).val(1).change(); //Finally change the value to 1
});
//Action on user's click(OFF)
dsb.on('click', function() {
$(enb).removeClass('selected'); //remove "selected" from other elements in this object class(ON)
$(this).addClass('selected'); //add "selected" to the element which was just clicked in this object class(OFF)
$(input).val(0).change(); // //Finally change the value to 0
});
});
});