$(document).on('click', '.icon-weixin', function () { //微信 var url = "/qrCode/Index.aspx?url=" + window.location.href; //alert(url) var title = '' title += "
" title += "x" title += '

二维码

' title += "
" title += '

扫一扫

' title += '
' $('body').remove('.weixin') $('body').append(title) //var op="http://service.weibo.com/share/share.php?url='"+ url +"'&title='"+ title +"'&searchPic=false" //window.open(op) $(window).scroll(function () { if ($(this).scrollTop() > 0) { $('body').addClass('scrollHeader') } else { $('body').removeClass('scrollHeader') $('body').removeClass('scrollHeader') } }) }) $(document).on('click', '.weixin .c', function () { //alert(0) $('.weixin').remove() }) $(document).on('click', '.icon-weibo', function () { //微博 var url = $(this).data('txt') var url = window.location.href var title = document.title var op = 'http://service.weibo.com/share/share.php?title=' + title + '&url=' + encodeURIComponent(url) + '' window.open(op) }) //手机导航 $(document).on('click', '.menu_h', function () { $(this).parents('body').toggleClass('menu-open') }) $(document).on('click', '.header nav ul li .mobile_nav_btn', function (e) { e.preventDefault() e.stopPropagation() if ($(this).parent().hasClass('open')) { $(this).parent().removeClass('open').siblings('selector') } else { $(this).parent().addClass('open').siblings().removeClass('open') } }) // $(function () { mapselect() wowInt() var _select = $('.select_choose') _select.on('click', function (e) { e.preventDefault() e.stopPropagation() $(this).hasClass('on') ? $(this).removeClass('on') : $(this).addClass('on') }) _select.find('.drop_list').on('click', 'p', function (event) { event.preventDefault() $(this).parent().siblings('input').val($(this).text()) //查找您身边的办事处 if ($(this).parent().hasClass("getBntRegionCity")) { getBntRegionCity(); } //招聘信息 if ($(this).parent().hasClass("getSociology")) { getSociology($("#TJobType").val(), 1); } }) $(document).click(function (event) { $('.select_choose').removeClass('on') }) //// 招聘信息展开收起 //$('.tableContent .table01').on('click', function () { // var _box = $(this).parents('.tableContent') // _box.hasClass('on') ? _box.removeClass('on') : _box.addClass('on') //}) if (!placeholderSupport()) { // 判断浏览器是否支持 placeholder $('input').each(function () { var self = $(this) var val = self.attr('placeholder') input(self, val) if ($(this).val() == '' && $(this).attr('placeholder') != '') { $(this).val($(this).attr('placeholder')) $(this).focus(function () { if ($(this).val() == $(this).attr('placeholder')) $(this).val('') }) $(this).blur(function () { if ($(this).val() == '') $(this).val($(this).attr('placeholder')) }) } }) $('input[type="password"]').each(function () { var pwdField = $(this) var pwdVal = pwdField.attr('placeholder') var pwdClass = pwdField.attr('class') // 重命名该input的id为原id后跟1 pwdField.after( '' ) var pwdPlaceholder = $(this).siblings('.login-input') pwdPlaceholder.show() pwdField.hide() pwdPlaceholder.focus(function () { pwdPlaceholder.hide() pwdField.show() pwdField.focus() }) pwdField.blur(function () { if (pwdField.val() == '') { pwdPlaceholder.show() pwdField.hide() } }) }) } // 申请试用弹窗 $('.toApplyBtn').on('click', function (event) { event.preventDefault() $("input[name='SingleLine4']").val($(this).attr("data-name")); $('.form_pop').show() }) $(".toApplyBtnID").on('click', function (event) { event.preventDefault(); $("input[name='SingleLine4']").val($(this).attr("data-name")); getRegionCity($(this).attr("data-id"), "sTrialEquipment"); $(".form_pop").show() }); $(".toApplyBtnID").on('click', function (event) { event.preventDefault(); //$("#sSingleLine5").val($(this).attr("data-name")); $("input[name='SingleLine4']").val($(this).attr("data-name")); getRegionCity($(this).attr("data-id"), "sTrialEquipment"); $(".form_pop").show() }); $('.form_pop_btn_close').on('click', function (event) { event.preventDefault() //$('.form_pop').hide().find('input').val('') $('.form_pop').hide(); $("input[name='Title']").val(''); $("input[name='Title1']").val(''); $("input[name='SingleLine1']").val(''); $("input[name='SingleLine2']").val(''); $("input[name='SingleLine3']").val(''); $("input[name='code']").val(''); $("input[name='SingleLine4']").val(''); }) $(".head_1A_fir_t a").hover(function() { var _idx = $(this).index() $(this).addClass('on').siblings().removeClass('on'); $(this).parents(".child").find(".child_second").removeClass('on').eq(_idx).addClass('on') }, function() { /* Stuff to do when the mouse leaves the element */ }); }) function wowInt() { if (!/msie [6|7|8|9]/i.test(navigator.userAgent)) { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 100, mobile: true, live: true, }) wow.init() } } // 判断浏览器是否支持placeholder属性 function placeholderSupport() { return 'placeholder' in document.createElement('input') } // jQuery替换placeholder的处理 function input(obj, val) { var $input = obj var val = val $input.attr({ value: val }) $input .focus(function () { if ($input.val() == val) { $(this).attr({ value: '' }) } }) .blur(function () { if ($input.val() == '') { $(this).attr({ value: val }) } }) } //end /*ie9的texdarea的placeholder兼容*/ $(function () { if ($('html').hasClass('lt10')) { var $textarea = $('textarea') //获取元素集合 $.each($textarea, function (i, el) { //遍历 if ($(el).text() == '') { $(el).siblings('.ieTextarea').removeClass('ieTextHide') } else { $(el).siblings('.ieTextarea').addClass('ieTextHide') } }) $('.ieTextarea') .off('focus') .focus(function () { //span聚焦的时候 $(this).addClass('ieTextHide') $(this).siblings('textarea').focus() //模仿textarea聚焦 }) $('textarea') .off('blur') .blur(function () { if ($(this).text() == '') { $(this).siblings('.ieTextarea').removeClass('ieTextHide') //失焦的时候让模拟span显示 } }) $('textarea') .off('focus') .focus(function () { $(this).siblings('.ieTextarea').addClass('ieTextHide') }) } }) function mapselect() { $('.map_select').each(function (i) { $(this) .find('dt') .click(function (e) { if ($(this).hasClass('on_o')) { $(this).removeClass('on_o') } else { $(this).addClass('on_o') } e.preventDefault() e.stopPropagation() $('.map_select') .eq(i) .find('dd a') .each(function (x) { $(this).click(function () { $('.map_select').eq(i).find('dd a').removeClass('on') $(this).addClass('on') $('.map_select').eq(i).find('dt p').text($(this).text()) $('.map_select') .eq(i) .find('dt') .attr({ 'data-val': $(this).data('val') }) $('.map_select') .eq(i) .find('dt') .attr({ 'data-city': $(this).text() }) $('.map_select') .eq(i) .find('dt') .attr({ 'data-x': $(this).data('x') }) $('.map_select') .eq(i) .find('dt') .attr({ 'data-y': $(this).data('y') }) $('.mapbox_text ul') .eq($(this).index()) .addClass('on') .siblings() .removeClass('on') }) }) }) }) $(document).click(function () { $('.map_select dd').hide() $('.map_select dt').removeClass('on_o') }) $('.map_select dt').on('click', function (e) { if ($(this).siblings('.map_select dd').is(':hidden')) { $(this).siblings('.map_select dd').show() $(this) .parents('.map_select') .siblings('.map_select') .children('.map_select dd') .hide() } else { $(this).siblings('.map_select dd').hide() } }) } function mapInt(mapTitle, mapAdress, mapx, mapy) { var map = new BMap.Map('map') var point = new BMap.Point(mapx, mapy) var point2 = new BMap.Point(mapx, mapy) //坐标偏移 var point2 = new BMap.Point(mapx+0.05,mapy); if ($(window).width() > 1024) { var myIcon = new BMap.Icon( '../images/cont_address.png', new BMap.Size(60, 108) ) // icon按钮 } else { var myIcon = new BMap.Icon( '../images/cont_address.png', new BMap.Size(28, 50) ) // icon按钮 } var marker2 = new BMap.Marker(point2, { icon: myIcon }) // 创建标注 map.addOverlay(marker2) // 将标注添加到地图中 map.centerAndZoom(point, 15) var opts = { width: 200, // 信息窗口宽度 height: 100, // 信息窗口高度 title: mapTitle, // 信息窗口标题 } map.enableScrollWheelZoom() //启用滚轮放大缩小,默认禁用 map.enableContinuousZoom() //启用地图惯性拖拽,默认禁用 }