简体   繁体   English

如何在按下“提交”按钮后将显示保持在当前幻灯片[javascript滑块]上

[英]how to keep the display on the current slide [javascript slider] after submit button is pressed

Situation: 情况:

I have a webpage utilzing a javascript slider [tiny slider from scriptiny dot com]. 我有一个网页使用javascript滑块[scriptiny dot com的微小滑块]。
I created a contact form on the last slide with jquery validation and php validation. 我在最后一张幻灯片上使用jquery验证和php验证创建了联系表格。
Everything works fine EXCEPT for: 除了以下方面,一切工作正常:
After clicking on Submit, the webpage displays the first slide. 单击提交后,网页将显示第一张幻灯片。
Not sure hot to make it stick to the contact "slide". 不确定会使其粘在触点“滑动”上。

Site navigation is done using a string like: 网站导航使用以下字符串完成:

onclick="slideshow.pos(0)  
onclick="slideshow.pos(1)  
onclick="slideshow.pos(2)  
onclick="slideshow.pos(3)  
onclick="slideshow.pos(4)

I need the contact "slide" to stay on "slideshow.pos(4)". 我需要联系人“幻灯片”停留在“ slideshow.pos(4)”上。

Code: 码:

//If there is no error, send the email 
if(!isset($hasError)){ 
    $emailTo = 'myemail@gmail.com'; //Put your own email address here 
    $body = "Name: $name \n\nEmail: $email \n\nSubject: $subject \n\nComments:\n $comments"; 
    $headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email; 
    mail($emailTo, $subject, $body, $headers); 
    $emailSent = true; 
}

How can I do this? 我怎样才能做到这一点? Ideally, I would be able to run some javascript after the email is sent making the refresh of the page send the user to "slideshow.pos(4)"?? 理想情况下,在发送电子邮件后,我将能够运行一些JavaScript,以刷新页面,将用户发送到“ slideshow.pos(4)”?
Any help would be appreciated, 任何帮助,将不胜感激,

Mark 标记

You can "submit" your data with an Ajax call and avoid the page from refreshing in the first place. 您可以使用Ajax调用“提交”数据,并避免页面首先刷新。 If you never used Ajax take some time to look at https://developer.mozilla.org/en/ajax . 如果您从未使用过Ajax,请花一些时间查看https://developer.mozilla.org/en/ajax

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM