Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Update script.js #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 6 additions & 62 deletions Stream-1/Unit19-jquery_events/events_in_jquery/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,16 @@ $(document).ready(function(){

//applies colour red to paragraphs when clicked on
$("p").click(function(){
$("p").addClass( "highlight_text");
$("p").addClass("highlight_text");
});

//will add lightblue to h2 elements
$("h2").hover(function(){
$("h2").addClass( "h2_color");
});

/*this will apply larger font size to the active h2 element
/* this will add lightblue to h2 elements and will apply larger font size to the active h2 element
by adding the h2_font_size class but
not the other h2 elements by removing class h2_font_size from them*/

$("#hr_html").hover(function(){
$("#hr_mysql").removeClass("h2_font_size");
$("#hr_python").removeClass("h2_font_size");
$("#hr_jquery").removeClass("h2_font_size");
$("#hr_django").removeClass("h2_font_size");
$("#hr_css").removeClass("h2_font_size");
$("#hr_mysql").removeClass("h2_font_size");
$("#hr_html").addClass("h2_font_size");

});

$("#hr_mysql").hover(function(){
$("#hr_python").removeClass("h2_font_size");
$("#hr_jquery").removeClass("h2_font_size");
$("#hr_django").removeClass("h2_font_size");
$("#hr_css").removeClass("h2_font_size");
$("#hr_html").removeClass("h2_font_size");
$("#hr_mysql").addClass("h2_font_size");
});

$("#hr_python").hover(function(){
$("#hr_mysql").removeClass("h2_font_size");
$("#hr_jquery").removeClass("h2_font_size");
$("#hr_django").removeClass("h2_font_size");
$("#hr_css").removeClass("h2_font_size");
$("#hr_html").removeClass("h2_font_size");
$("#hr_python").addClass("h2_font_size");
});

$("#hr_jquery").hover(function(){
$("#hr_mysql").removeClass("h2_font_size");
$("#hr_python").removeClass("h2_font_size");
$("#hr_django").removeClass("h2_font_size");
$("#hr_css").removeClass("h2_font_size");
$("#hr_html").removeClass("h2_font_size");
$("#hr_jquery").addClass("h2_font_size");
});

$("#hr_django").hover(function(){
$("#hr_mysql").removeClass("h2_font_size");
$("#hr_python").removeClass("h2_font_size");
$("#hr_jquery").removeClass("h2_font_size");
$("#hr_css").removeClass("h2_font_size");
$("#hr_html").removeClass("h2_font_size");
$("#hr_django").addClass("h2_font_size");
});

$("#hr_css").hover(function(){
$("#hr_mysql").removeClass("h2_font_size");
$("#hr_python").removeClass("h2_font_size");
$("#hr_jquery").removeClass("h2_font_size");
$("#hr_django").removeClass("h2_font_size");
$("#hr_html").removeClass("h2_font_size");
$("#hr_css").addClass("h2_font_size");
$("h2").hover(function(){
$("h2").addClass("h2_color");
$("h2").removeClass("h2_font_size");
$(this).addClass("h2_font_size");
});

//applies colour black to body background when mouse enters over buttons
Expand Down