Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] qTip 1.0rc3 modal worked once only
17th February, 16:34 (This post was last modified: 17th February 16:47 by FBL.)
Post: #1
[Solved] qTip 1.0rc3 modal worked once only
Hi,

Can you help with this code, I copied it from your site.
I have tried it in 4 different browsers and the results are the same.

i am using qTip 1.0. i can't change to v2.0 as other codes are dependent on it. I tried the conversion on the old codes, but most won't work. So I am stuck with 1.0rc3

It grey-ed out the page but no modal box shows. The modal box showed only once.

It worked only once and refused to work after.
JS Code
$('a[rel="modal"]').qtip(
			   {
			      content: {
			         title: {
			            text: 'Modal qTip',
			            button: 'Close'
			         },
			         text: 'Heres an example of a rather bizarre use for qTip... a tooltip as a <b>modal dialog</b>! ' +
			               'Much like the <a href="http://onehackoranother.com/projects/jquery/boxy/">Boxy</a> plugin, ' +
			               'but if you\'re already using tooltips on your page... <i>why not utilise qTip<i> as a modal dailog instead?'
			      },
			      position: {
			         target: $(document.body), // Position it via the document body...
			         corner: 'center' // ...at the center of the viewport
			      },
			      show: {
			         when: 'click', // Show it on click
			         solo: true // And hide all other tooltips
			      },
			      hide: false,
			      style: {
			         width: { max: 350 },
			         padding: '14px',
			         border: {
			            width: 9,
			            radius: 9,
			            color: '#666666'
			         },
			         name: 'light'
			      },
			      api: {
			         beforeShow: function()
			         {
			            // Fade in the modal "blanket" using the defined show speed
			            $('#qtip-blanket').fadeIn(this.options.show.effect.length);
			         },
			         beforeHide: function()
			         {
			            // Fade out the modal "blanket" using the defined hide speed
			            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
			         }
			      }
			   });
 
			   // Create the modal backdrop on document load so all modal tooltips can use it
			   $('<div id="qtip-blanket">')
			      .css({
			         position: 'absolute',
			         top: $(document).scrollTop(), // Use document scrollTop so it's on-screen even if the window is scrolled
			         left: 0,
			         height: $(document).height(), // Span the full document height...
			         width: '100%', // ...and full width
 
			         opacity: 0.7, // Make it slightly transparent
			         backgroundColor: 'black',
			         zIndex: 5000  // Make sure the zIndex is below 6000 to keep it below tooltips!
			      })
			      .appendTo(document.body) // Append to the document body
			      .hide(); // Hide it initially


HTML
JS Code
echo "<div class=\"qtip\">
<a rel=\"modal\" href=\"#\">Click here</a></div>";
Find all posts by this user
Quote this message in a reply
17th February, 18:31
Post: #2
RE: qTip 1.0rc3 modal worked once only
Don't use the .qtip class for other elements except qTip!!! It will cause big problems, especially in the 1.0 releases. Other than that, here's the proper code conversion so you can use qTip2 (not sure why it didn't work in the converter for you...):

JS Code
$('a[rel="modal"]').qtip({
	content: {
		title: {
			text: "Modal qTip",
			button: "Close"
		},
		text: "Heres an example of a rather bizarre use for qTip... a tooltip as a <b>modal dialog</b>! Much like the <a href=\"http://onehackoranother.com/projects/jquery/boxy/\">Boxy</a> plugin, but if you're already using tooltips on your page... <i>why not utilise qTip<i> as a modal dailog instead?"
	},
	position: {
		target: $(document.body),
		my: "center",
		at: "center"
	},
	show: {
		solo: true,
		event: "click",
		modal: true
	},
	hide: false,
	style: {
		classes: "ui-tooltip-light"
	}
})


CSS Code
.ui-tooltip-light {
	max-width: 350px;
	padding: 14px;
	border-width: 9px;
	-webkit-border-radius: 9px;
	-moz-border-radius: 9px;
	border-radius: 9px;
	border-color: #666666;
}

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Position of qTip Modal from call within a tooltip chuuke 1 263 17th January 21:54
Last Post: Craig
  qTip modal accept/decline form jinx8402 0 440 15th December 13:34
Last Post: jinx8402
  Modal tooltips on modal tooltips Dukegatts 2 535 17th June 07:38
Last Post: Dukegatts
  [Solved] Help with Multipe Modal IDs stanbridge 5 806 31st March 04:50
Last Post: stanbridge
  [Solved] modal qTip taller than screen, are scrollbars possible? perlguy 3 2,406 6th March 22:26
Last Post: skjoldby
  [Solved] Convert 1.0RC3 TO 2.0 Miki 2 619 26th February 14:33
Last Post: Miki
  [Solved] Swap between showing qTip as a tooltip and as a modal window Surya 3 1,191 16th February 20:53
Last Post: Craig
  [Solved] Tips don't show when Modal is re-opened in Safari twitch 3 1,511 18th November 13:07
Last Post: twitch
  How To Open Modal qTip On A Different Frame digitaljoni 1 1,464 19th August 14:46
Last Post: Craig
  [Solved] Add styles to outer modal box, but not to qTips?? pavsid 4 1,777 4th July 14:41
Last Post: Craig



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