Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
close modal dialog from inside the content
1st October, 23:08
Post: #1
close modal dialog from inside the content
How I can close a modal dialog from a link inside the content??
Find all posts by this user
Quote this message in a reply
4th October, 21:12
Post: #2
close modal dialog from inside the content
siriusblack, use the 'hide' API command:

JS Code
$(linkElementInModal).click(function(){ $(this).parents('.qtip').qtip('hide') });

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
20th April, 16:37
Post: #3
RE: close modal dialog from inside the content
Hey Craig,

I'm having a hard time getting this to work as well. My code is below (including the method used to call the tip)

qtip Code
JS Code
// Approval Terms
$('.approval_terms').click(function(e){e.preventDefault();}).each(function(){​
  var $this = $(this),
      formTitle = $this.attr('title'),
      firstClass = $this.attr('class').split(' ').shift(),
      formContent = $('#' + firstClass).html(); // look for id that matches link's class
      $this.qtip({
        content: {
          text: formContent,
          title:
          {
            text: formTitle,
            button: 'Close'
          },
          text: formContent
        },
        position: {
          corner: {
            target: 'topMiddle',
            tooltip: 'bottomLeft'
          }
        },
        style: {
          width: 500,
          tip:  'bottomLeft',
          border: {
            radius: 8,
            width: 2
          },
          name: 'sesameGreen'
        },
        show: {
          when: 'click',
          solo: true
        },
        hide: {
          when: 'click',
          fixed: true,
          delay: 500
        }
    });


Destroy Method
JS Code
//destroy tooltip when "cancel" is clicked
$('a.cancel').click( function() {
    $(this).parents('.qtip').qtip("hide");
});


I've tried to use a modified version of the above code within the onRedender/onShow methods and all I get is a parseError.

Any light you can shed on this would be great!
Find all posts by this user
Quote this message in a reply
21st April, 17:57
Post: #4
RE: close modal dialog from inside the content
jchandler, if you stick your second piece of code in the onRender callback of the API it should work just as you expect. Or even better, use a live call instead of a regular bind:

JS Code
//destroy tooltip when "cancel" is clicked
$('a.cancel').live('click', function() {
    $(this).parents('.qtip').qtip("hide");
});

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
  Open a modal popup window from a click inside qtip poojakudesia 1 1,125 10th August 19:32
Last Post: Craig
  How customize content modal tooltip? dannythegreat 7 3,188 25th December 16:49
Last Post: Spoonless Eddie
  [Solved] qTp modal dialog , on page load c0mrade 5 3,962 13th August 16:13
Last Post: mattsyk
  Open a new tip on a tip close hari41980 3 1,739 31st August 11:49
Last Post: Craig
  Forcing Tips to Close Before Next Opens... PrimaryNumbers 10 2,574 17th August 16:07
Last Post: Craig
  Close a qTip from inside the tip content? ChimneyMedia 3 4,626 6th August 12:36
Last Post: Craig
  qTip fixed and always visible inside img caesar2k 2 2,665 14th May 14:51
Last Post: caesar2k
  Close button instead of link? rseshadr 2 4,919 25th March 23:05
Last Post: rseshadr



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