Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-15-2011, 03:21 AM   PM User | #1
pisike
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
pisike is an unknown quantity at this point
Question replace a div with other div inside of each <li>

does somebody knows how to replace a div with other one that is inside of a <li> tag?
i already tried this...

$("#image").html($(this).find(".flist-image").html());
but for some reason isn't working as i want..

inside of each div with the class flist-image is a link of image that is a light box and is not working...
can somebody help me pls??
this is part of the code...
Code:
	$(document).ready(function(){
		$(".flist li").click(function(){
			$(".flist li.selected img").fadeTo("normal");
			$(".flist li.selected").removeClass("selected");
			$(this).find("img").fadeTo("fast");
			$(this).addClass("selected");
			$('#image').replaceWith(function() {
  					return $(".flist-image").contents();
				});
 			$("#image").html($(this).find(".flist-image").html());
			$("#viewmore").html($(this).find(".flist-content").html());
		});
Code:
 <li>
        <img src="images/thumbs.jpg" />
                <div class="flist-content">
                      <a href="#" id="code">View Code</a>
                      <a href="#" id="larger">View Larger</a>                                    
                 </div>
                 <div class="flist-image">
                      <img src="images/our_work2.jpg" />                                   
                  </div>
 </li>
pisike is offline   Reply With Quote
Reply

Bookmarks

Tags
jquery urgent help, replace divs

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:27 PM.


Advertisement
Log in to turn off these ads.