Results 1 to 6 of 6

Thread: Marquee Scroll from Another Document

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

    Default Marquee Scroll from Another Document

    Hi All,

    I am a newbie to HTML. I have only been designing and building websites for 4 weeks!! So please be gentle! lol

    I have used some 'marquee' scrolling text in a new website project. This script and content will be in the same place on nearly every page. I would like to try and code the script to obtain the content from another file (if possible). So that by amending this file, I can change the scrolling text on all pages.

    Ideally, I need to know the script to put in to the page and also how to set up the file so that the script reads it correctly and scrolls the text within this.

    This is my current simple script:

    <marquee behavior="scroll" scrollamount="4" direction="left" onmouseover="this.stop();" onmouseout="this.start();" style="font-size: 15px; font-weight: bold; font-family: 'Trebuchet MS';"><span style="font-family: Arial, 'Arial Unicode MS', Helvetica, sans-serif; color: #404040;">text about latest news and projects</span></marquee></p>

    The text in Bold is what I want to be replaced by short sentences/headlines running after each other taken from another document. I have tried using 'src='. But I can not get it to work, so either I have not set up the src file correctly or I am putting the src script in the wrong place within the marquee tags maybe? My web pages are html.

    Also I know nothing about Java programming and coding so ideally I would like to amend the above!

    Help would be much appreciated!!

    P.S. I have tried http://www.dynamicdrive.com/dynamicindex2/emarquee.htm but I cannot get this to work either.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,965
    Thanks
    16
    Thanked 305 Times in 304 Posts
    Blog Entries
    11

    Default

    The marquee tag is quite outdated by today's standards.

    Might I suggest that you use another DD script? One that reads from a common file? http://www.dynamicdrive.com/dynamici...ajaxticker.htm

    Also, to assist you further we would need to see a live web page - we have no way of knowing how you're setting up your scripts otherwise, and a live page would be the easiest way for us to help you set them up correctly.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  3. #3
    Join Date
    Dec 2012
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks Bev,

    My very first site is currently at http://www.dev.kenwhitesigns.co.uk

    This is very much work in progress.

    Any help would be much appreciated.

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,965
    Thanks
    16
    Thanked 305 Times in 304 Posts
    Blog Entries
    11

    Default

    Hi spiper,

    Looking at things in context (nice looking site BTW - you must have a natural eye for design if this is your first project) I think this might be the script for you: http://www.dynamicdrive.com/dynamici...ryscroller.htm

    What's nice about this script is that instead of pasting all the code into your page (where your current <marquee> is) you can turn it into an external JavaScript file, so you only update one file and any changes show on all your pages.

    The other nice feature about this script is that is remembers the postition of the last message, so imagine how much more user-friendly that will be for visitors as they browse around your site - they'll be able to see the messages in sequence without having to watch them all scroll from the begining at each new click.

    So, to turn the script into one common, external js file, copy and paste all the code provided in the DD demo page here: http://www.dynamicdrive.com/dynamici...ryscroller.htm and save it in a file called "memoryscroller.js". Upload that to the scripts folder on your server.

    Next, take out the opening and closing javascript tag from the very beginning and the very end of your new "memoryscroller.js" file
    - so that's the "<script type="text/javascript">" line at the top, and the "</script>" line at the bottom.

    Then, on your web pages, in place of your current <marquee>, put this;
    Code:
    <script type="text/javascript" src="path/to/memoryscroller.js"></script>
    Also, to create some space between each message, you could just use a string of &nbsp; (non-breaking spaces) in the place where you define your message;
    Code:
    var memorycontent='<nobr><span style="font: bold 13px Verdana">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you find this script useful, please consider <a href="http://www.dynamicdrive.com/link.htm">linking to</a> or <a href="http://www.dynamicdrive.com/recommendit/">recommending</a> Dynamic Drive.</span></nobr>'
    Or alternatively, you could use a <span>;
    Code:
    var memorycontent='<nobr><span style="font: bold 13px Verdana">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> <span style="display:inline-block;width:50px;"></span> If you find this script useful, please consider <a href="http://www.dynamicdrive.com/link.htm">linking to</a> or <a href="http://www.dynamicdrive.com/recommendit/">recommending</a> Dynamic Drive.</span></nobr>'
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  5. The Following User Says Thank You to Beverleyh For This Useful Post:

    spiper (12-10-2012)

  6. #5
    Join Date
    Dec 2012
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks very much Bev!!

    Tested and working like a charm. I will be now spending the afternoon changing the scripts!

    Your a STAR!

  7. #6
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,965
    Thanks
    16
    Thanked 305 Times in 304 Posts
    Blog Entries
    11

    Default

    Twinkle, twinkle - its nearly Xmas after all
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

Similar Threads

  1. Add Scroll Bar to Cross Browser Marquee II
    By keithusc in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 02-27-2012, 11:43 AM
  2. Tabbed Document Viewer - Scroll Adjust
    By erichamby in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 03-05-2008, 03:11 AM
  3. Vertical Scroll - Marquee
    By webdesg in forum JavaScript
    Replies: 2
    Last Post: 06-19-2006, 05:05 PM
  4. Text/Message scroll using Marquee
    By babumazumder in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 06-01-2005, 10:19 AM
  5. HV menu & Scroll Marquee didn't get along...
    By sdennyc in forum JavaScript
    Replies: 1
    Last Post: 03-13-2005, 10:00 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
  •