Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone!

Just a quick question on your thoughts of the best way to have an image marquee, in a div that has overflow set as hidden.

At the moment I have a marquee set up but my problem is that I have several images, and the div itself is only wide enough to fit 2 or 3 images in, and so the remaining images appear underneath the first three.

Basically I need them all to be inline with eachother so the viewer can see each one (I have tried display:inline and disply:inline-block and made no difference)

So if anyone has any ideas on how my problem can be resolved, or any good sites that you can download a free marquee html and js source?

Thanks,
Tom.
Posted
Comments
vino2012 2-Apr-12 9:13am    
post your code.......I already crossed this kind of gallery...

OK so in my html head I have:
<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>

<script type="text/javascript">

    $(document).ready(function(){

        var marquee = $(".thumb_holder");

        marquee.wrapInner("<span>");

        marquee.find("span").css({ "width": "50%", "display": "inline-block", "text-align":"center" });

        marquee.append(marquee.find("span").clone());
        
        marquee.wrapInner("<div>");

        marquee.find("div").css("width", "200%");

        
        var reset = function() {

        $(this).css("margin-left", "0%");

        $(this).animate({ "margin-left": "-100%" }, 10000, 'linear', reset);
        };
        
        reset.call(marquee.find("div"));

    });

</div></span></script>
</script>

And in my html body I have:
<div class="thumb_holder" style="overflow: hidden; float: left; height: 131px; width: 435px;">

<a class="group1" href="../images/marquee/image_1.jpg" title="">

<img src="../images/marquee/thumbs/image_1.jpg" style="float: left; border: 1px solid #a5a1a0;" />

</a>

<a class="group1" href="../images/marquee/image_2.jpg" title="">

<img src="../images/marquee/thumbs/image_2.jpg" style="float: left; margin-left: 10px; border: 1px solid #a5a1a0;" />

</a>

<a class="group1" href="../images/marquee/image_3.jpg" title="">

<img src="../images/marquee/thumbs/image_3.jpg" style="float: left; margin-left: 10px; border: 1px solid #a5a1a0;" />

</a>

<a class="group1" href="../images/marquee/image_4.jpg" title="">

<img src="../images/marquee/thumbs/image_4.jpg" style="float: left; margin-left: 10px; border: 1px solid #a5a1a0;" />

</a>

<a class="group1" href="../images/marquee/image_5.jpg" title="">

<img src="../images/marquee/thumbs/image_5.jpg" style="float: left; margin-left: 10px; border: 1px solid #a5a1a0;" />

</a>

<a class="group1" href="../images/marquee/image_6.jpg" title="">

<img src="../images/marquee/thumbs/image_6.jpg" style="float: left; margin-left: 10px; border: 1px solid #a5a1a0;" />

</a>

</div>
 
Share this answer
 
Comments
Michel [mjbohn] 2-Apr-12 10:14am    
Please use "Improve question" to alter/complete your question.
Don't post it as solution.
I dont have the


on the second to last line of the top code above, dont know where that just cam from
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900