Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Pure JS Image Gallery no libraries, no plugins

    Hello guys,

    I was wondering if someone could help me out. I am trying to create an image gallery in javascript without the use of jquery, mootools or any other library. The tutorials out there and even the javascript books I own all use jquery or other library.

    I currently have some thumbnails and when clicked, they should display a bigger image in a selected space.

    The image gallery is to be looped and to start automatically while being controlled by buttons or thumbnails. What is the best way to go about this, please bear in mind that I am quite new javascript itself.

    Thanks
    Vou
    Last edited by iamvou; 01-03-2011 at 03:53 PM.

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,335
    Thanks
    11
    Thanked 588 Times in 569 Posts
    after having have created my own, i would use jQuery if i had to do it again.

    look at the spaghetti of dom and event code i used in the source of http://danml.com/pub/photos.htm . granted, much of it is for zooming, which you didn't mention, but consistently sizing things in the dom is a real PITA.

    the code is a couple years old at this point, and i would write it better now, but it should give you an idea. Feel free to rip off chunks if it helps.

    My advice would be to first write out every feature you need in english. Under each feature, write out english programming outlines on how you plan to accomplish the feature. Once you have a complete plan, pick a feature, most important first, anmd start coding. Cross off each section when you successfully add the feature and it doesn't break old functionality. Without libraries, there's gonna be a whole lot of little chunks. Planning is a big, if boring, part of writing a great app.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  • #3
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your help, I will give it a go and let you know how it works out. Left to me as well I would use jquery or some other library but as it is not allowed in this case, I'll go with your suggestions. Again thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •