javascript - I am unable to make jQuery Work. What am I missing? -
I am trying to hide, show, change the images, but I am unable to do anything. I see the button but nothing is happening. Is the link for jQuery wrong or is it something else? What I've done does not work, it's not sure what to do at this point ...
& lt; Html lang = "en-us" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; JQuery & lt; / Title & gt; & Lt; Script src = "// ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> & Lt; Link type = "text / css" rel = "stylesheet" href = "jquery.css" /> & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("img"). AddClass ("wrappedElement"); $ ("# Hide All Images"). Click (function () {$ ("img"). " Fast "); $ (" Show all images ") (function () {$ (" img "). Show (" sharp ");}); $ (" # Show image as well ") ($: "Visible"). {$ ("(Visible :)" and "show (" sharp ");}}); $ (" show image # "). Click (function (.) {If ( $ (": Visible") & amp; $ (": visible:") ($: "visible:") {$ ("img: even") shows ("sharp" );} And {$ ("IMG: weird"). Show ("sharp");}}); $ ("# right shift") Click (function () {$ ("Img") .slideRight ();}); $ ("# left shift"). Click (function () {$ ("img"). SlideLeft ();});}); & lt; / Scripts & gt;
button id = "Hide all images" & gt; Hide all images & lt; / button & gt; & lt; button ID = "even show picture" & gt; Show image & lt; / Button & gt; Button ID = "Show Strange Image" & gt; Show OD Images & lt; / Button & gt; & Lt; Button ID = "Right Shift" & gt; The right shift & lt; / Button & gt; & Lt; Button ID = "Left Shift" & gt; Left shift & lt; / Button & gt; & Lt; / Div & gt; & Lt; Div id = "content" & gt; & Lt; Img class = "photo" src = "photo_one.jpg" alt = "one" & gt; & Lt; Img class = "photo" src = "photo_two.jpg" alt = "two" & gt; & Lt; Img class = "photo" src = "photo_three.jpg" alt = "three" & gt; & Lt; Img class = "photo" src = "photo_four.jpg" alt = "four" & gt; & Lt; Img class = "photo" src = "photo_five.jpg" alt = "five" & gt; & Lt; / Div & gt; & Lt; / Body & gt;
Remove empty space from your classes and id, substituted Do underscores them (or hyphens, or whatever you want)
For example:.
& lt; Button ID = "Hide_All_Images" & gt; / Button & gt; Hide & lt for all images;
and:. Click on
$ ("# Hide_All_Images") (function () {
Really use empty space $ function means something $ ("#include all imagery")
means gt
inside & lt; image & gt;
Tag inside something with ID Hide .
Comments
Post a Comment