Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Javascript scrolling not working in Chrome

Posted on 2014-03-03
5
Medium Priority
?
370 Views
Last Modified: 2014-06-01
Hi Experts,

i use the following Javascript function to scroll content in i div container, and it works in Ie, Firefox and Safari + iPad Safari, but NOT in Chrome.

Anyone knows why? heres the code:

<script type="text/javascript">
function toLeft(id){
document.getElementById(id).scrollLeft=0
}

defaultStep=1
step=defaultStep
function scrollDivLeft(id){
document.getElementById(id).scrollLeft+=step
timerLeft=setTimeout("scrollDivLeft('"+id+"')",5)
}
</script>
------------------
<style type="text/css">
.div4 {
  position: relative;
  text-align: center;
  font-family:Verdana, Geneva, sans-serif;
  font-size:12px;
  color:#FFFFFF;
  width: 500px;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: hidden;
  z-index:3;
}
</style>
--------------------------------------
Container:

        <div id="thumbs" class="div4">
        <table>
            <%
            for each img in imgs
            nr = nr+1
                  title = replace(img.Name, ".jpg", "")
                  reptitle = Right(title, Len(title) - 3)
            %>
        <td height="60px">
        <img class="thumbn" src="Abergphotos/<%=img.Name%>" height="50px" id="img<%=nr%>" onmouseover="this.style.cursor='pointer'" onclick="chgimg('<%=nr%>', this.id, this.src, '<%=reptitle%>');" />
        </td>
        <%next%>
        </tr>
        </table>
        </div>

<input type="button" value="left"  onmousedown="scrollDivLeft('thumbs');">

Best regards
MortenWB
0
Comment
Question by:MortenWB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 16

Expert Comment

by:SriVaddadi
ID: 39900760
Looks like you are missing <tr>. You have </tr> but i don't see <tr> any where.

Can't really say looking at the above snippet.  

Launch development tools in chrome and look at the console for any errors.
0
 

Author Comment

by:MortenWB
ID: 39901036
Hi SriVaddadi,

thanks for commenting. And oh, the <tr> is in some of the code I left out in order to make it faster to read in this post - its in a table wrapped around the code.
I'll try to check the development console.
0
 

Accepted Solution

by:
MortenWB earned 0 total points
ID: 39901055
Well - it may be a chrome version problem - had to download Chrome to the Mac i'm currently working on, and the code works perfectly there - the problem were on another Mac-Chrome... thought that Chrome updated automatically...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Several part series to implement Internet Explorer 11 Enterprise Mode
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
This video will take you through the Acquisition tab overview.  You will learn to navigate All Traffic and Organic Keywords. It will take you through the Social Overview, Site Content, and Real Time tabs. Click on Acquisition – Overview : Look at Al…
This Micro Tutorial will demonstrate Chrome and Firefox's extension MozBar, which allows you to easily highlight followed, no followed, internal, and external links on a page. It is also used to highlight keywords on a page to for adequate optimized…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question