I had someone from this site help me out with a slider problem I was having and I just need someone to help me with the final piece of the puzzle.
This is the Fiddle http://jsfiddle.net/gajjuthechamp/vrqdh/2/
At the moment when you click on the “thumbnail” the content appears in the main div above.
I need the divs/thumbnails under “extraContent” have it’s own unique content div under “mainContent”.
Hope this makes sense.
Thanks
jQuery:
$(function(){
$("#parent").on("click", ".extraContent div", function(){
newHtml=$(this).html();
$("#parent").find(".mainContent p").fadeOut(1000,function(){
$(this).parent().html(newHtml);
$(this).parent().fadeIn(1000);
});
});
});
HTML:
<div id="parent">
<div class="mainContent"> <p>This is the default Text</p></div>
<div class="extraContent">
<div><p>test and Image Goes hear for 1 div</p></div>
<div><p>test and Image Goes hear for 2 div</p></div>
<div><p>test and Image Goes hear for 3 div</p></div>
<div><p>test and Image Goes hear for 4 div</p></div>
</div>
</div>
CSS:
#parent { width:400px; margin:auto}
.mainContent { width:430px; height:300px; border:1px solid #000;padding:5px; }
.extraContent {overflow:auto; width:450px;}
.extraContent div{float:left; width:90px; height:90px; border:1px solid #00F; margin:5px; padding:5px }
.extraContent div:hover { border:1px solid #0F0;cursor:pointer }
jsFiddle demo
HTML:
ADDED CSS:
jQuery: