Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to load different content each time
26th May, 02:26
Post: #1
how to load different content each time
hi,
i've implemented the modal qtip example. When there is only 1 <a rel=modal> everything runs fine. When there is more than 1 modal, something wrong happens and only the first rendered modalbox shows info.

qTip settings
JS Code
$(document).ready(function(){
	$('a[rel="modal"]').qtip({
		content:{
			text: '<h2 id="title"></h2>'
		}
	});
});


HTML
JS Code
<span id="title-1">Nice title 1</span>
<a href="j<strong></strong>quick(1);" rel="modal">Link 1</a>
 
<span id="title-2">Nice title 2</span>
<a href="j<strong></strong>quick(2);" rel="modal">Link 2</a>
 
<span id="title-3">Nice title 3</span>
<a href="j<strong></strong>quick(3);" rel="modal">Link 3</a>


Then, i have the quick() javascript function that updates the data in the modal box with the value in the spans that are outside:

qTip settings
JS Code
function quick(id){
	$('#title').text($('#title-'+id).text());
}


How can i update the value of the modalbox by taking values from outside html tags referenced by an ID?
Find all posts by this user
Quote this message in a reply
28th May, 16:00
Post: #2
RE: how to load different content each time
nevermind... this approach saved my day Wink
http://craigsworks.com/projects/forums/t...-page-load
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Dynamic Content on first show, not page load TheOverbob 6 6,397 2nd August 13:01
Last Post: Craig
  Tutorial: Dynamic content on first load using ajax Abrasive 2 4,334 22nd July 08:50
Last Post: shopjuicys63
  [Solved] Displaying tooltip on page load/mouseover otherwise burghars 1 977 18th July 11:55
Last Post: Craig
  show fixed on the first time cyberziz 2 1,038 11th March 08:29
Last Post: cyberziz
  Load an HTML Page Within qTip Tooltip BruceBruce 3 2,723 19th January 12:17
Last Post: Craig
  [Solved] qTp modal dialog , on page load c0mrade 5 3,599 13th August 16:13
Last Post: mattsyk
  Callbacks fire on page load when they shouldn't anomalous 1 1,165 4th February 22:12
Last Post: anomalous



User(s) browsing this thread: 1 Guest(s)