模仿不同div的点击

时间:2016-10-13 13:00:10

标签: javascript jquery

目前使用可联系并触发以下内容:

$('#my-contact-div').contactable({
  subject: 'feedback URL:'+location.href,
  header: '',
  url: 'mail.php',
  name: 'Name',
  email: 'Email',
  message : 'Message',
  submit : 'SEND',
  recievedMsg : 'Thank you for your message',
  notRecievedMsg : 'Sorry but your message could not be sent, try again later',
  footer: 'Please feel free to get in touch, we value your feedback',
  hideOnSubmit: true
});

但是,我希望能够在单击其他div时将此表单区域滑开。由于.contactable脚本附加到#my-contact-div,我是否需要模拟div上的点击?

例如,在另一个名为div的{​​{1}}上,以便在点击此项时,它会被注册为.linkClick被点击。

1 个答案:

答案 0 :(得分:0)

通过使用以下内容更改js文件对其进行排序:

jQuery('#contactable-inner,.formLink').toggleClick(function() {
    jQuery('#contactable-overlay').css({display: 'block'});
    jQuery('#contactable-inner').animate({"marginRight": "-=5px"}, "2000");
    jQuery('#contactable-contactForm').animate({"marginRight": "-=0px"}, "2000");
    jQuery('#contactable-inner').animate({"marginRight": "+=387px"}, "4000");
    jQuery('#contactable-contactForm').animate({"marginRight": "+=390px"}, "4000");
}

            <!-- + HEADER -->
            <div class="top-message-container">
                <div class="inner-container">
                    <div class="topHeroImage">
                        <img src="images/core_head_logo.png" alt="Evans '56 Calftone">
                        <div class="header_intro_text">Get started by choosing your instrument below</b>.
                        </div>
                    </div>  

                </div>
            </div>
            <!-- - END HEADER -->               



            <!-- + NAVIGATION ... -->
            <div class="navigation-container">
                <div class="inner-container">
                    <a href="#1"><img src="images/guitar_bass-icon.png"></a> <a href="#2"><img src="images/percussion-icon.png"></a> <a href="#3"><img src="images/orchestral-icon.png"></a> <a href="#4"><img src="images/woodwinds-icon.png"></a>         
                </div>  


                <div class="main-video-container">
                    <div class="fret_vids" id="1">
                        <div class="videoPlayer" id="video1" style="display: none;">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/R3O7if2Koks?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_intro.jpg" alt="Intro Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video2" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/xWbZuje4LAc?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_1.jpg" alt="Round 1 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video3" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/5O2zaA02c_Y?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_2.jpg" alt="Round 2 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video4" style="display:">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4 selected"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/HKYInO4T4T4" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_3.jpg" alt="Round 3 Video"></a>
                            </div>
                        </div>
                    </div>


                    <div class="perc_vids" id="2">
                        <div class="videoPlayer" id="video1" style="display: none;">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/R3O7if2Koks?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_intro.jpg" alt="Intro Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video2" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/xWbZuje4LAc?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_1.jpg" alt="Round 1 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video3" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/5O2zaA02c_Y?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_2.jpg" alt="Round 2 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video4" style="display:">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4 selected"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/HKYInO4T4T4" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_3.jpg" alt="Round 3 Video"></a>
                            </div>
                        </div>
                    </div>


                    <div class="orch_vids" id="3">
                        <div class="videoPlayer" id="video1" style="display: none;">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/R3O7if2Koks?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_intro.jpg" alt="Intro Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video2" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/xWbZuje4LAc?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_1.jpg" alt="Round 1 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video3" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/5O2zaA02c_Y?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_2.jpg" alt="Round 2 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video4" style="display:">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4 selected"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/HKYInO4T4T4" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_3.jpg" alt="Round 3 Video"></a>
                            </div>
                        </div>
                    </div>


                    <div class="wood_vids" id="4">
                        <div class="videoPlayer" id="video1" style="display: none;">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/R3O7if2Koks?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_intro.jpg" alt="Intro Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video2" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/xWbZuje4LAc?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_1.jpg" alt="Round 1 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video3" style="display: none">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3 selected"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/5O2zaA02c_Y?list=PLnWoocIzrCpDJBVXJqJnB5iJE66Owoxbg" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_2.jpg" alt="Round 2 Video"></a>
                            </div>
                        </div>
                        <div class="videoPlayer" id="video4" style="display:">
                            <div class="video-playlist">
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video1');" class="video_btn_1"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video2');" class="video_btn_2"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video3');" class="video_btn_3"></a><br />
                                <a href="javascript:void(0)" onMouseUp="chooseTab('video4');" class="video_btn_4 selected"></a><br />
                            </div>
                            <div class="video-image">
                                <a href="http://youtu.be/HKYInO4T4T4" rel="prettyPhoto"><img src="http://www.daddario.com/resources/newsletters/heavyweight/heavyweight_video_round_3.jpg" alt="Round 3 Video"></a>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="prod-slider-container">
                    <div class="slider_header_text" id="1"><b>LIKE WHAT YOU SAW?</b> Purchase the products seen in the videos.</div>                        
                </div>
            </div>
            <!-- - END NAVIGATION ... -->