Results 1 to 2 of 2

Thread: featuredcontentslider.init in external js file

  1. #1
    Join Date
    Aug 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default featuredcontentslider.init in external js file

    1) Script Title:
    Featured Content Slide

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...tentslider.htm

    3) Describe problem:
    I would like to know if i can place:

    Code:
    featuredcontentslider.init({
    	id: "carousel",  //id of main slider DIV
    	contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
    	toc: "markup",  //Valid values: "#increment", "markup", ["label1", "label2", etc]
    	nextprev: ["Previous", "Next"],  //labels for "prev" and "next" links. Set to "" to hide.
    	revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
    	enablefade: [true, 0.1],  //[true/false, fadedegree]
    	autorotate: [true, 6000],  //[true/false, pausetime]
    	onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
    		//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
    		//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
    	}
    })
    into an external js file, and how to go about doing it.
    If this can't be done, an explaination as to why not.

    I have spent a long time researching this and haven't got far.


    Thanks

    Andy
    Last edited by jscheuer1; 08-31-2012 at 03:22 PM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Sure, using a text only editor like NotePad, copy and paste that code into a new file. Save it as - say, contentsliderinit.js and place it in the same folder as the page using it.

    Then on your page, where:

    Code:
    <script type="text/javascript">
    featuredcontentslider.init({
    	id: "carousel",  //id of main slider DIV
    	contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
    	toc: "markup",  //Valid values: "#increment", "markup", ["label1", "label2", etc]
    	nextprev: ["Previous", "Next"],  //labels for "prev" and "next" links. Set to "" to hide.
    	revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
    	enablefade: [true, 0.1],  //[true/false, fadedegree]
    	autorotate: [true, 6000],  //[true/false, pausetime]
    	onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
    		//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
    		//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
    	}
    })
    </script>
    would have been replace it with:

    Code:
    <script type="text/javascript" src="contentsliderinit.js"></script>
    The browser cache may need to be cleared and/or the page refreshed to see changes.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. how to modify featuredcontentslider?
    By romy in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 03-08-2011, 04:37 PM
  2. Help please with featuredcontentslider
    By mwscrl in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-10-2010, 08:23 PM
  3. Replies: 0
    Last Post: 12-09-2009, 03:41 PM
  4. FeaturedContentSlider 2.4 external htm & Javascript
    By tigger5 in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 02-04-2009, 10:57 PM
  5. external js file
    By simurg in forum JavaScript
    Replies: 2
    Last Post: 11-23-2007, 07:11 AM

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
  •