I have this structure:

includes/top.php : This contains <head> tags, jQUery library & functions :

<script type="text/javascript">
    function makeslider()
{
        $('#coin-slider').coinslider({ width: 605,height: 450, navigation: true, delay: 5000 });
    }
</script>

page.php : here have the #coin-slider div, but when I call the makeslider() function it doesn't turn my div into the coin slider ( http://workshop.rs/projects/coin-slider/ )

If I put everything on the same page it works, but when I seperate the function and libraries in the top.php, and the div in page.php it won't work..

I suspect that makeslider() is being called too soon. Use $(document).ready() or equivalent. Note: sometimes merely placing the script containing the call at the end of the body is enough to solve the timing problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.