Results 1 to 7 of 7

Thread: [DHTML] EasySlide

  1. #1
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Arrow [DHTML] EasySlide

    1) CODE TITLE: EasySlide

    2) AUTHOR NAME/NOTES: Brady Mulhollem, http://www.webtech101.com

    3) DESCRIPTION: EasySlide is an image slideshow script that features quite a few options, while remaining simple to setup(no javascript knowledge required). I know there are more powerful scripts out there, but the goal of this script was to include most features, be fast to load, easy to setup, AND work in most modern browsers. My favorite part of this script is the unique way in which it is configured, I might even have to port that code to multi-level effect menu.

    4) URL TO CODE: http://www.webtech101.com/uploads/EasySlide/demo.html

  2. #2
    Join Date
    Feb 2007
    Location
    Burnsville, MN
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Wow nice. The code is very clean as well! Great job.

  3. #3
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    LOVE IT!!! 10/10 You're truly an animation guru!! Works extremely well and fast(even on my slowest computer).

  4. #4
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Thanks you guys! Any suggestions?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    if(window.addEventListener){
        window.addEventListener("load",EasySlideLoad,false);//W3C load advanced model
    }
    else if(window.attachEvent){
        window.attachEvent("onload",EasySlideLoad);//IE advanced model
    }
    Don't forget to use window.onload = function(){}; as a backup. Also, be consistent with your semicolons: ECMAScript will insert a semicolon after that anonymous function (since it forms part of a statement).
    Code:
    		this.parent.innerHTML += '<div class="EStitle">'+this.images[0].alt+'</div>';//Add the first title
    Ouch... try:
    Code:
    var d = document.createElement("div");
    d.className = "EStitle";
    d.appendChild(document.createTextNode(this.images[0].alt));
    this.parent.appendChild(d);
    innerHTML is non-standard and should be avoided where possible.
    Code:
    EasySlide.prototype.getConfig = function(name,default_val){
    	var classname = this.parent.className;//Store the classname
    	var array = classname.split(name+'(');//split the string at the config name
    	if(array.length > 1){//make sure it existed
    		var temp = array[1];//store almost what we want
    		return temp.split(')')[0];//cut off the extra and return it
    	}
    	else{
    		return default_val;//Variable is not included. return the default
    	}
    }
    Easier:
    Code:
    EasySlide.prototype.getConfig = function(name,default_val){
    	var m = this.parent.className.match(new RegExp("\\b" + name + "\\(([^\\)]+)\\)"));
    	if(m) return m[1];
    	else return default_val;
    }
    There are two other problems I have with it: a) it should be possible to set the colour of the title on a per-slide basis, since different slides with have different backgrounds, and b) the slide effect doesn't work in KHTML/KJS (the fade doesn't either, but it degrades nicely; the slide simply doesn't show anything).

    Other than that, great work! I'm impressed.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by Twey View Post
    ECMAScript will insert a semicolon after that anonymous function
    What anonymous function?
    a) it should be possible to set the colour of the title on a per-slide basis, since different slides with have different backgrounds
    Thanks for the idea! I have added it with the title_color option(check the demo page)
    b) the slide effect doesn't work in KHTML/KJS (the fade doesn't either, but it degrades nicely; the slide simply doesn't show anything).
    Weird, I dug out my Slax live CD and checked. The first time I loaded the page, nothing. But when I refreshed the page it suddenly worked. Could you check again and see if refreshing helps?
    Other than that, great work! I'm impressed.
    Thanks!

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Yes, a very nice script! Good job.
    - Mike

Bookmarks

Posting Permissions

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