You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LiaoningYaopinIframe/public/static/diaowen/js/dw/responsive-width.js

107 lines
2.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
*
* DWSurvey 3.0
*
* @desc: design survey
* @author: keyuan@keyuan, keyuan258@gmail.com
* @github: https://github.com/wkeyuan/DWSurvey
*
* Copyright 2012, 2017 调问问卷(DWSurvey,http://dwsurvey.net)
*
*/
$(document).ready(function(){
// $(".createSsUl li").unbind();
//
// $(".createSsUl li").hover(function(){
// if(toggleTag){
// toggleTag=false;
// var stepLi=$(this);
//// $(".a-w-sel").not(stepLi.find(".a-w-sel")).slideUp("slow",function(){
//// stepLi.find(".a-w-sel").slideDown("slow",function(){
//// toggleTag=true;
//// });
//// });
// stepLi.find(".a-w-sel").slideToggle("slow",function(){
// toggleTag=true;
// });
// $(".a-w-sel").not(stepLi.find(".a-w-sel")).slideUp();
// }
// return false;
// },function(){
// $(".a-w-sel").slideUp("slow",function(){
// toggleTag=true;
// });
//
// return false;
// });
var toggleTag=true;
$(".clickHideUserMenu,.clickHideMenu").unbind();
$(".clickHideUserMenu,.clickHideMenu").click(function(){
if(toggleTag){
toggleTag=false;
var stepLi=$(this).parent();
// $(".a-w-sel").not(stepLi.find(".a-w-sel")).slideUp("slow",function(){
// stepLi.find(".a-w-sel").slideDown("slow",function(){
// toggleTag=true;
// });
// });
/* stepLi.find(".a-w-sel").slideToggle("slow",function(){
toggleTag=true;
});
$(".a-w-sel").not(stepLi.find(".a-w-sel")).slideUp();
*/
if(stepLi.find(".a-w-sel")[0]){
stepLi.find(".a-w-sel").slideToggle(0,function(){
toggleTag=true;
});
}else{
toggleTag=true;
}
//$(".a-w-sel").not(stepLi.find(".a-w-sel")).slideUp();
$(".a-w-sel").not(stepLi.find(".a-w-sel")).hide();
}
return false;
});
$(document).click(function(){
//$(".a-w-sel").slideUp("slow");
$(".a-w-sel").hide();
});
});
var browseWidth=$(window).width();
var browseHeight=$(window).height();
function resizeBodyWidth(){
browseWidth=$(window).width();
if(browseWidth>=1120){
$(".bodyCenter").width(browseWidth-160);
}else{
$(".bodyCenter").width(960);
}
}
function resizeBodyHeight(){
//autoContentHeight
browseHeight=$(window).height();
var autoCHeight=browseHeight-230;
$(".autoContentHeight").height(autoCHeight);
$("#autoIframeHeight").height(autoCHeight-5);
}
//窗口大小发生改变时
$(window).resize(function(){
resizeBodyWidth();
resizeBodyHeight();
});
function refreshAutoCode(codeImgId){
var ctx=$("#ctx").val();
$("#"+codeImgId).attr("src",ctx+"/jcaptcha.action");
}
function currentMenu(menuId){
$(".dw-menu-a").removeClass("active");
$("#"+menuId).addClass("active");
}