You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
5 years ago
|
$(document).ready(function() {
|
||
|
if ($('.TO, .DT, .IN, .WDT, .WP, .MD, .PRP, .CC').click(function() {
|
||
|
$('.TO, .DT, .IN, .WDT, .WP, .MD, .PRP, .CC').toggleClass('hide'); // reset
|
||
|
}));
|
||
|
|
||
|
else ($('span').click(
|
||
|
function(){
|
||
|
var selectedclass = $(this).attr('class');
|
||
|
$('span').css('background-color', 'white').css('color','black'); // reset
|
||
|
$('span.' + selectedclass).css('background-color', '#FF4500').css('color', 'white'); //highlighting the select
|
||
|
}));
|
||
|
})
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
final code
|
||
|
$(document).ready(function(){
|
||
|
$('.TO, .DT, .IN .WDT, .WP, .MD, .PRP, .CC').click(
|
||
|
function() {
|
||
|
$('.TO, .DT, .IN .WDT, .WP, .MD, .PRP, .CC').css('color','black'); // reset
|
||
|
$('.TO, .DT, .IN .WDT, .WP, .MD, .PRP, .CC').css('color', 'white');
|
||
|
});
|
||
|
})
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
$(document).ready(function(){
|
||
|
$('span').click(
|
||
|
function(){
|
||
|
var selectedclass = $(this).attr('class');
|
||
|
$('span').css('background-color', 'white').css('color','black'); // reset
|
||
|
$('span.' + selectedclass).css('background-color', '#FF4500').css('color', 'white'); //highlighting the select
|
||
|
});
|
||
|
})
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
same:
|
||
|
$(document).ready(function() {
|
||
|
if ($('.TO, .DT, .IN, .WDT, .WP, .MD, .PRP, .CC').click(
|
||
|
function() {
|
||
|
$('.TO, .DT, .IN, .WDT, .WP, .MD, .PRP, .CC').toggleClass('hide'); // reset
|
||
|
}));
|
||
|
})
|
||
|
|