jquery - Switch divs through sidemenu -


i'm pretty new , sorry title, didn't know else call it.

i'm trying make little menu 2 divs inside div. left div text. right div multiple images which, when clicked, link other pieces of text shown in left divs.

and when other text appears image directing first piece of text goes menu on right side.

i know i'm not explaining well. don't know how else explain it.

this html, maybe helps

<div id="home">     <div id="leftblock">         <img src="/images/links/image1.png" alt="image 1"width="160"/>         #atekst#     </div>     <div id="rightblock">         <img src="/images/links/image2.png" alt="image 2" width="160"/>         <img src="/images/links/image3.png" alt="image 3" width="160"/>     </div> </div> 

sorry delay, here work in progress fiddle you. haven't manged add text functionality yet, because have other work. asap.

this should set on way in meantime.

    $('#rightblock').on('click', '.image', function(e) {   $('.yourpic').children('img').attr('src', $(e.target).attr('src'));  }); 

essentially looks @ righblock div , images therein, , onclick add them div class of "yourpic"

edit: hey, here updated fiddle hides image on right. i'm not sure if effective / efficient way of doing it, that's how approached it.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -