Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getsimple 3.1 Contactable Feedback/Contact Form
#66
(2013-06-30, 16:39:54)giggty Wrote: hello ! Wink
love your plugin !

i just have a little quation ...
what if i wanted to "toggle" the form from an outside ID click event,
like from a <a> tag...
10x ! great plugin !

Nevermind Smile cracked it....

if anybody ever wondered how to do this it's really simple :

look at the default plugin code :

Code:
//show / hide function
            $('div#contactable, #contactablea').toggle(function() {
                $('#overlay').css({display: 'block'});
                $('div#contactable').animate({"marginRight": "-=5px"}, "fast");
                $('#contactForm').animate({"marginRight": "-=0px"}, "fast");
                $('div#contactable').animate({"marginRight": "+=387px"}, "slow");
                $('#contactForm').animate({"marginRight": "+=390px"}, "slow");
            },
            function() {
                $('#contactForm').animate({"marginRight": "-=390px"}, "slow");
                $('div#contactable').animate({"marginRight": "-=387px"}, "slow").animate({"marginRight": "+=5px"}, "fast");
                $('#overlay').css({display: 'none'});
            });

**now just change "this" to 'div#contactable' and add another ID as following:


Code:
//show / hide function
            $('div#contactable, #contactablea').toggle(function() {
                $('#overlay').css({display: 'block'});
                $('div#contactable').animate({"marginRight": "-=5px"}, "fast");
                $('#contactForm').animate({"marginRight": "-=0px"}, "fast");
                $('div#contactable').animate({"marginRight": "+=387px"}, "slow");
                $('#contactForm').animate({"marginRight": "+=390px"}, "slow");
            },
            function() {
                $('#contactForm').animate({"marginRight": "-=390px"}, "slow");
                $('div#contactable').animate({"marginRight": "-=387px"}, "slow").animate({"marginRight": "+=5px"}, "fast");
                $('#overlay').css({display: 'none'});
            });

then just stick the id to the a href tag :
example :
Code:
<a id="contactablea" href="#">link name</a>

hope this helps some1 Smile
Reply


Messages In This Thread
RE: Getsimple 3.1 Contactable Feedback/Contact Form - by giggty - 2013-06-30, 23:42:22



Users browsing this thread: 1 Guest(s)