【发布时间】:2015-05-02 23:51:53
【问题描述】:
我有一个水平滚动的网站。它适用于 Firefox,但不适用于 Chrome。
http://jellekok.com/customers/udiverse/
知道为什么它不能在 Chrome 中运行吗?
主JS文件:jquery1.8.2.min.js
水平滚动javascript:
/* jQuery.ScrollTo - Easy element scrolling using jQuery - Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com - Dual licensed under MIT and GPL - Date: 3/9/2009 - @author Ariel Flesler - @version 1.4.1 - http://flesler.blogspot.com/2007/10/jqueryscrollto.html */
;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy ',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function() {return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html',' body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode =='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0 }if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j= j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a. over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is ('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(.\d+)?(px)?$/ .test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d) )。的fset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase() ,c='滚动'+f,r=k[c],s=h=='x'?'宽度':'高度';if(p){g[c]=p[i]+(q ?0:ro.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt (d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+= ds.toLowerCase()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]
/* jQuery.LocalScroll - 使用锚点的动画滚动导航 - 版权所有 (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com - MIT 和 GPL 双重许可 - 日期:3/11/2009 - @author Ariel Flesler - @version 1.2.7 / ;(function($){var l=location.href.replace(/#./,'');var g=$.localScroll=function(a){$('body').localScroll( a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location .hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target ).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults, b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e )i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)})。 end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this) .is(b.filter))}};函数 i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[ 0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore .call(b,a,f,h)===false)return;if(b.stop)h。 stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('').attr(j,d).css({position: '绝对',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location= e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);
/* 触发水平滚动 */ $(document).ready(function () {$.localScroll.defaults.axis = 'x'; $.localScroll(); });
这是滑动 div 的 html:
<div id="one">
<div class="content">
<ul class="bxslider">
<li><img src="img/coaching.jpg" title="" /></li>
<li><img src="img/girl_1.jpg" title="" /><span>"Magali is helpful, devoted and really involved in your success. Furthermore, she is a truly devoted person. She's not only a career coach but she is also personally involved and committed to the person she is working with."</span></li>
<li><img src="img/boy_1.jpg" title="" /><span>"Magali is very flexible with her clients and fully immerses herself in the desire to get to the core of your career needs. She is very organized with a positive outlook. Magali helped me find answers to some of the fundamental questions I had regarding my professional journey."</span></li>
<li><img src="img/girl_2.jpg" title="" /><span>"Magali is an efficient and dedicated person who has helped me improve my CV and solicitation letters. She was very helpful when advising me on how to improve my interview skills."</span></li>
<li><img src="img/boy_2.jpg" title="" /><span>"Magali has been my career coach and adviser since last summer when I was lost in my professional orientation and I couldn't seem to succeed in job interviews anymore. She helped me to be confident again and after only one month I found a job and some new professional goals!"</span></li>
<li><img src="img/cheers.jpg" title="" /><a href="#eight" class="gtk">Schedule your <br />'Get to know' session</a></li>
</ul>
<h1>Career and Cross-Cultural Coaching<br /> for Expatriates and International Workers</h1>
<h2>"Diversify your unique career"</h2>
<ul>
<li>You are unaware of your strengths and what you should do for a living</li>
<li>You live abroad and you are now stuck in your career</li>
<li>You are unsure how to begin your job search and feel disoriented in an unfamiliar culture</li>
<li>You experience culture shock, you are uncertain on how to prepare for your relocation or have issues adapting to other cultures</li>
</ul>
<br />
U Diverse helps you explore your dream career, hunt for your ideal job, successfully advance in your career and adapt seamlessly to a new culture.
</div>
<div class="wrapper">
<a href="#two" class="next">><br />You are..</a>
</div>
</div>
<div id="two">
<div class="content">
<h1>You are..</h1>
<h2>"Uniquely diverse"</h2>
<ul id="job_types">
<li><img src="img/explorer.jpg" alt="" /><br />Explorer<span>You are unclear about the next step of your career and would like to explore<br /> different options.</span></li>
<li><img src="img/conqueror.jpg" alt="" /><br />Conqueror<span>You are clear about the next steps of your career and you are now looking for the right opportunity.</span></li>
<li><img src="img/hunter.jpg" alt="" /><br />Hunter<span>You are in the right career opportunity and you want to improve your satisfaction level and advance your career.</span></li>
<li><img src="img/nomad.jpg" alt="" /><br />Global Nomad<span>You plan to work abroad or have moved abroad and need help transitioning into a new culture.</span></li>
</ul>
<br clear="all" />
</div>
<div class="wrapper">
<a href="#three" class="next alt">><br />Explore..</a>
</div>
</div>
【问题讨论】:
-
您需要提供复制问题所需的最少代码,而不是指向我们的链接。
标签: javascript google-chrome horizontal-scrolling