javascript - Showing info when clicking on specified text -
i'm dutch boy own website , i'm kind of new programming. know little basic html, knowledge stops there. wanted create on page offer services computer , more.
on left want have services listed , on right info service. don't want info on right, want appear , disappear when click service on same page. when no service clicked, want have text explanation services , more. want possibility change info , add images , html plugins. think possible html5 (or javascript, maybe jquery) don't know how.
want test it: http://webguideict.com/test/
website running on wordpress , might slow because of hoster have (bluehost), i'm doing on own , cheap, know why.
there programmers can , want me problem? preferably pre-written code or simple explained, love learn!
in advance!
thomas
your specific question sounds jquery/javascript.
html:
<h2>services:</h2> <ul> <li id="con"> consulting </li> <li id="pro"> programming </li> <li id="brd"> longboarding </li> </ul> <div id="msg"></div>
jquery:
$('li').click(function(){ var svc = $(this).attr('id'); //alert(svc); if (svc=="con"){ $('#msg').html('<h2>professional services</h2>i can computer consulting.'); }else if(svc=="pro"){ $('#msg').html('<h2>beanie work</h2>if can conceive it, can code it.'); }else if(svc=="brd"){ $('#msg').html('<h2>sidewalk surfing</h2>grocery deliveries style...'); } });
thomas, there many great sites free tutorials doing stuff want.
i recommend doing @ least of these (free) 10-minute tutorials, , of them if want learn. place start:
phpacademy.org
thenewboston.com
200 ten-minute jquery tuts
register & login tutorial
this invaluable resource consulting/memorizing jquery selectors/methods:
jquery selectors
jquery events
just keep hitting next chapter
, take through 6 more pages... print , store in little reading room down hall...
Comments
Post a Comment