jquery - I want to load different images to a div, from links -


There is a very new jQuery and alive on your amazing tutorial.

I am working on my portfolio website, and there is a list of projects that use jQuery's load functions, when each project is loaded to load in a separate division. There is a set of numerical links within each statement, say 1-5, which I want to display the relevant images in one more division when I click. My problem is so far away that I can not reuse the load function because it overwrites the internal use, and it does not seem that it resonates in php file which holds all my project details.

Is there any way to it?

I'm just guessing because I have not seen your code, but when you dynamically Loads using Ajax, no javascript will be executed inside the new content.

The best way around this will be to use the new loaded content to link the link, which replaces the image source when clicked - there is no need to catch an image Here's some example code to use for load:

Main page JavaScript (I did not include the load function)

  $ ('. Project') . Live ('click', Attr ('src', newImg);})  

HTML in loaded content

  & lt; Div id = "content" & gt; & Lt ;! - This content was loaded dynamically - & gt; & Lt; Img class = "projectImg" style = "float: right" /> & Lt; Ul & gt; & Lt; Li class = "project" data-img = "project1.jpg" & gt; Project 1 & lt; / Li & gt; & Lt; Li class = "project" data-img = "project2.jpg" & gt; Project 2 & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -