You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.8 KiB
JavaScript
101 lines
3.8 KiB
JavaScript
6 years ago
|
//Tip
|
||
|
$(function(){
|
||
|
$('.couponPromo').mouseenter(
|
||
|
function(e)
|
||
|
{
|
||
|
$('.couponTip').show(100);
|
||
|
}
|
||
|
)
|
||
|
$('.couponPromo').mouseleave(
|
||
|
function()
|
||
|
{
|
||
|
var _tobj = setTimeout(function(){
|
||
|
$('.couponTip').hide(100);
|
||
|
},50);
|
||
|
$('.couponTip').mouseenter(function(){
|
||
|
clearTimeout(_tobj);
|
||
|
});
|
||
|
}
|
||
|
)
|
||
|
$('.couponTip').mouseleave(function(){
|
||
|
var _tobjs = setTimeout(function(){
|
||
|
$('.couponTip').hide(100);
|
||
|
},50);
|
||
|
$('.couponPromo').mouseenter(function(){
|
||
|
clearTimeout(_tobjs);
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
if( typeof(questiontype) == "undefined") {
|
||
|
questiontype = ""
|
||
|
}
|
||
|
document.writeln("<script type='text/javascript' src='http://data.chinahighlights.com/js/jquery.sticky-kit.js'>\<\/script>");
|
||
|
document.writeln("<script type='text/javascript' src='http://data.chinahighlights.com/js/in-field-labels/jquery.infieldlabel.min.js'>\<\/script>");
|
||
|
document.writeln("<script type='text/javascript' src='http://data.chinahighlights.com/js/validation/jquery.validate.min.js'>\<\/script>");
|
||
|
document.writeln("<form action=\"/forms/reserve-tour-simple-save.asp\" id=\"formquestion\" method=\"post\" novalidate=\"novalidate\">");
|
||
|
document.writeln("<div id=\"questionBox\"> ");
|
||
|
document.writeln(" <span class=\"interested\">Quick Inquiry</span> <span class=\"interest-label\">Each tour can be tailored.</span>");
|
||
|
document.writeln(" <div class=\"infoRequired\">");
|
||
|
document.writeln(" <p>");
|
||
|
document.writeln(" <label for=\"realname\">Full Name: </label>");
|
||
|
document.writeln(" <input name=\"realname\" type=\"text\" id=\"realname\" value=\"\" />");
|
||
|
document.writeln(" </p>");
|
||
|
document.writeln(" <p>");
|
||
|
document.writeln(" <label for=\"yemail\">Email: </label>");
|
||
|
document.writeln(" <input name=\"yemail\" type=\"text\" id=\"yemail\" value=\"\" />");
|
||
|
document.writeln(" </p>");
|
||
|
document.writeln(" <p class=\"des\">");
|
||
|
document.writeln(" <label for=\"Aquestion\">Requirements:<br>How many people?<br>Departure date & days?<br>Where to visit? ");
|
||
|
document.writeln(" </label>");
|
||
|
document.writeln(" <textarea name=\"Aquestion\" id=\"Aquestion\"></textarea>");
|
||
|
if ( questiontype == 'contactus' ) {
|
||
|
document.writeln(" <input type=\"hidden\" name=\"questiontype\" value=\"contactus\" />");
|
||
|
}
|
||
|
document.writeln(" <input type=\"hidden\" name=\"Q_URL\" id=\"Q_URL\" />");
|
||
|
document.writeln(" </p>");
|
||
|
document.writeln(" </div>");
|
||
|
document.writeln(" <input type=\"submit\" value=\"Send my inquiry\" class=\"sendButton\">");
|
||
|
document.writeln("</div>");
|
||
|
document.writeln("</form>");
|
||
|
$(function() {
|
||
|
$("#questionBox .infoRequired p").show();
|
||
|
$("#questionBox .infoRequired label").inFieldLabels();
|
||
|
$(".switchTags").stick_in_parent({parent: "#tourContent"});
|
||
|
$("#addtionalRight").stick_in_parent({parent: "#tourContent"}).on("sticky_kit:stick", function(e) {});
|
||
|
|
||
|
$(document).on("click",".error", function() {
|
||
|
$(this).parent("p").find(".arrowDownTest").remove();
|
||
|
});
|
||
|
$("#formquestion").validate({
|
||
|
rules: {
|
||
|
realname:{
|
||
|
required: true,
|
||
|
minlength: 1
|
||
|
},
|
||
|
yemail:{
|
||
|
required: true,
|
||
|
email: true
|
||
|
}
|
||
|
},
|
||
|
messages: {
|
||
|
realname: "Please enter a real name",
|
||
|
yemail: "Please enter a valid email address."
|
||
|
},
|
||
|
errorLabelContainer: "#questionBox .infoRequired p .arrowDownTest",
|
||
|
errorPlacement: function(error, element) {
|
||
|
var error_tip = "<div class=\"arrowDownTest\"><div class=\"arrowDown\"><img src=\"/css/images/whiteArrow.png\"></div></div>";
|
||
|
element.parent().append(error_tip);
|
||
|
error.appendTo(element.parent().find(".arrowDownTest"));
|
||
|
},
|
||
|
focusInvalid: true,
|
||
|
submitHandler: function(form){
|
||
|
//form.find(".arrowDownTest").show();
|
||
|
form.submit();
|
||
|
},
|
||
|
//debug: true
|
||
|
});
|
||
|
$("#Q_URL").val(location.href);
|
||
|
|
||
|
//---------------------------------------------------------------------------------------------------------------------------------------
|
||
|
});
|