News Ticker - Java Script

Hello,
This is the java script I use to create a news ticker on one of my pages. It can be included anywhere in your application - region header, body or footer:
<script language="JavaScript1.2">
Cross browser Marquee script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
Credit MUST stay intact
//Specify the marquee's width (in pixels)
var marqueewidth="300px"
//Specify the marquee's height
var marqueeheight="20px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=1
//configure background color:
var marqueebgcolor="#DEFDD9"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1
//Specify the marquee's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
var marqueecontent='<nobr><font face="Arial"><b>This is where my text goes.<b/></font></nobr>'
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee
function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
lefttime=setInterval("scrollmarquee()",20)
window.onload=populate
function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
write('</div></div>')
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
document.write('</td></table>')
</script>
This works fine and I would like to include some dynamic content into this script. Either some page iteme content or even some query results. My java script knowledge is quite "skinny" so I got to ask how to do that?
Thanks in advance,
Denes

Denes,
I just came across your thread.
Just replace within
var marqueecontent='<nobr><font face="Arial"><b>This is where my text goes.<b/></font></nobr>'...
the: "THIS is where the text goes." with: &P1_text.
and you can manipulate the text dynamically.
Ofcourse you hv to create the item P1_text and shortly after you keyed in s.th. and push "Enter" - then the data is in the Session (look at Session in Developer bar).
After "Enter" the ticker/marquee works with your data.
Alternative 2:
Define in Application Attributes under Static Substitution Strings a "GLOBAL_ITEM" with a value: say: my News - then replace &P1_TEXT. by &GLOBAL_ITEM. (beware of the '.' after the item !!! it has to be there !!
Alternative 3:
Work with a table:
A)Define a table called "NEWS" with the fields News_id, text, active_inactive - work with sequence..
B) Define form and report for data entry. In the form go to the item "active_inactive" and modify iot to be a radio-button with LOV : STATIC: Yes,No
C) still use the item P1_text and in the attributes of the item go to "Source" - select "SQL-Query" and key in:
select text from news where active_inactive = 'Yes' - modify the P1_text item as "hidden"
--> now you can manage your news and just the "Active" news are shown.
Advanced: make sure, that only one record is active !!
Have fun !! (:-)
Bernhard

Similar Messages

  • New to Java Script(Want to open a new window using Java Script)

    Hi all,
    I am new to using Java Script. Now I have a HTML(First.html) page with a ADD button at the end of the page. What I want to know is, if I drag and select some part of the First.html and click on the ADD button a second HTML page(Second.html) should open displaying only the selected contents....
    Please help :-(

    myRef = window.open(self.location,'mywin',
    'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

  • How to create a class using java script..

    Hi all,
    Iam new to java script and I tried out the following program but its not working..I basically created a class just like a java prog' but Iam not getting any output or error.Iam attaching the code below.
    If I created one function inside the script and create one object its working fine but what should I do when I have a lot of function??so I created a class and put all the function and created an object but its not working..
    Do let me know what changes should I do..Iam attaching the code which I had written. or give me an example of how to create a class with couple of functions using JAVASCRIPT
    Thanks
    Avis_su
    <html>
    <head><title>JSP Page</title></head>
    <body>
    <SCRIPT language = "JavaScript">
    <!--
    //Created classes
    class book
    var title: String;
    var author:String;
    function author()
    doucument.write("Author is " +this.author);
    function tile()
    doucument.write("Title is " +this.title);
    function printall()
    var counter = 0;
    function author();
    function title();
    var chapters = Array[String];
    for(chapter in this chapters)
    counter++;
    document.write("Chapter" counter" :"+this.chapters[chapter]+"<br>");
    var thisbook = new book()
    thisbook.author = "Sivagami";
    thisbook.title = "MS in CS giude";
    thisbook.chapters = new Array[10];
    thisbook[0] = "Prepare to Excell in all ";
    thisbook[1] = "Learn to be happy";
    thisbook[2] = "Learn to be healthy mentally emotionally physically";
    thisbook[3] = "Siva and Subbu along with kidssssss will be successful in future";
    thisbook.printall();
    //-->
    </script>
    </body>
    </html>

    Run this program to get your answer:
    public class AnswerToYourPost {
    public static void main(String args[]) {
    System.out.println("TRUE/FALSE: This question
    ion belongs on a Java forum.\n"
    + "ANSWER: " + ("Javascript" == "Java"));
    }Since when do we compare objects for equality using operator == ?

  • How to instantiate class in java script

    Hi, I'm new to java script. I have made a class in package project.attendance.model named CheckEmpId. I want to access methods of that class in my java script. Is it possible, if yes than how?
    Thanks

    Javascript is client side, Java is server side. That fact alone makes it impossible for javascript to invoke your java code.
    On the server side you have the ability to dynamically generate javascript however, so maybe you can fix your problem that way depending on what you want to achieve.

  • Prompts ,java script

    Hi experts,
    Hi have two date prompts if user selects two prompt values,the difference between the two prompt dates must not be more than 6 months.if any user selects more than 6 months i want to give a pop up messege like ex:"please choose another criteria,diffrence between two values must not be more than 6 months" with using java script..
    Am very new to java script and can please tell me how to use script in obiee and where to place that script and form where we have to call..
    And please give me your ideas on above 6month difference isuue....

    (Post Weekend Bump!)

  • When i have a ticked box for Java script i'm still not able to acess things on the i player. Why is this?

    I have tried to load Java Script so that i can watch things on the BBC i player. I have followed the instructions for loading Java Script as told on the BBC i player i.e i have a ticked box for Java Script but i still can't watch things on the i player. I seem to be doing something wrong, but not sure what it is!

    What error are you getting when you try ? If you are getting a network timeout then try temporarily turning off your firewall and antivirus software until the download has completed. Or you could downloading the update via a browser : https://discussions.apple.com/message/16436025#16436025

  • Spawn a new PDF using Java Script within LC Designer

    I am trying to spawn a new PDF file to be created from an existing PDF using Java Script within the LC designer
    I have this example but I can't get it to work
    function createPdf()
        pdf = pdf$();
        pdf.addText('Hello World');
        pdf.writeToFile('c:/temp/hello_world.pdf');
        window.open('file://c:/temp/hello_world.pdf');
    Is it possible to create a PDF like this within LC Designer?

    Hi
    I would like to see if it was possible.  I thought it would be easy, as
    there is a standard batch processing sequence (Print 1st page of all) using
    Java that comes with Acrobat 7.  This allows you to print the first page of
    a number of files that you select when the sequence is run.  Its code is:
    /* Print 1st Page */
    /* This sequence prints the first page of
       each document selected to the default printer.
    this.print
    To my uninformed mind it seemed logical that the same code, slightly
    modified to print all pages, should work from within a form.
    Anyway, if there is a way to choose individual files, I would appreciate
    that.
    Thanks
    Rob

  • What to do? When on a site with a PDF download I wish to open, the site commences to open in a new Tab but the information does not come through? This happens on all sites. The advanced Java Script is disabled.

    When on a site with a PDF download I wish to open, when I click on download the site commences to open in a new Tab but the information does not come through? This happens on all sites. The advanced Java Script is disabled. The new tab will sometimes flash black then go white with nothing else happening or just go white & nothing else?

    I had the same problem and also had PDF Download 3.0.02 installed. By removing this addon I can now select a PDF document which then opens up a normal Open With/Save dialogue allowing me to open the file or save it. Hope this helps.

  • How & where to use Java script to create new button in object detail page

    Hi All,
    I want to create "New/Add button" in object detail page. If i am not wrong i need to use java script for that but could you please let me know how & where to use Java script to create new button in object detail page in CRMOD.
    Thanks in advance.
    Regards,
    Manish

    Any related object on the detail page should have an "Add" or "New" or both buttons by default - This is vanilla functionality and will do the required action.
    If you want to modify this behaviour and do something tricky you will potentially have to go for javascript. You should add the javascript on a custom web tab on that Object.
    Admin --> Application Customization --> Contact -->Contact Web Applet
    Now, add your javascript in the code area, after you select the type = HTML for this web applet, expose this web applet on the Contact detail layout and your javascript will be invoked whenever this page is loaded.
    Check this online document to see how javascript can be embedded in CRM on Demand http://helponmyproject.com/TTOCOD/
    Cheers!
    Royston

  • Which method is ideal to transfer Java scripts from old documents to new ones?

    I have at least eight different single pages with specific java scripts and have these options:
    Copying from the «all edit java scripts» the whole piece to paste into the same window in the new Acrobat document (sometimes some fields lost function).
    Copying the specific java script located in «Document java scripts» i into the same window in the new Acrobat document , also with problems.
    Insert the specific page with a java script into the new one Acrobat document. This method has been perfect for the moment although I don't know if it is just orthodox enough to avoid conflicts in the future.

    !. Not recommended, you will pull all including fields, and document actions as well as overwrite existing form field and document actions.
    2. Possible but could be time consuming.
    3. Best choice. I would look at inserting a blank page into the PDF with the code, copy any fields with script to the blank page, save the file and then extract the inserted page. The page will also pickup the document actions and document level JavaScripts.
    Another option would be creating an FDF file to add the document level code and actions to a PDF.

  • Java script and the new and not improved firefox don't work. Please let me be able to run Java again.

    I use SAP Infoview for work. To modify reports it requires a Java script to run. I had it set up in the previous version of ff to always allow from this specific site and it worked wonderfully. Now, in the new version, despite following all of the instructions from others, I cannot do my work because I cannot run Java script. I can still run it in Safari, but Safari is a last resort for me to use. I prefer Firefox and have all of my links stored there.

    Some sites are not fully compatible with Firefox 4's new HTML5 rendering engine. Can you turn that off and test without it? Here are the steps:
    (1) Open a new tab, then type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the filter box, type or paste '''html5''' and pause while the list is filtered
    (3) Double-click '''html5.parser.enable''' to toggle it to false (it should turn bold).
    Then change back to the SAP tab and reload the page.
    Does that make any difference?

  • Java script application appearing everytime i open a new tab

    Hi,
    Everytime I open a new tab on my computer, a message pops up with Java script application in a box with a yellow triangle with an exclamation mark symbol. I have to click ok twice before I can continue using the internet.
    Can you please tell me how to fix this, I think this happened after I upgraded my mozilla website.

    hello annap2677, you have quite a few malicious addons present. please try these steps:
    # [[Reset Firefox – easily fix most problems|reset firefox]] (this will keep your bookmarks and passwords)
    # afterwards go to ''firefox > addons > extensions'' and in case there are still extensions listed there, disable them.
    # finally run a full scan of your system with different security tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes] and [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] to make sure that adware isn't present in other places of your system as well.
    [[Troubleshoot Firefox issues caused by malware]]

  • Hello Friends, I am new in InDesign Java Script

    Hello Friends,
    I am new in InDesign Java Script. I want to edit the page's master text Frame Object through Java Script. Any Idea regarding this will help me a lot.
    thanks in advance

    Have you read any of the documentation? It doesn't seem so :-)
    Vivek Singh, the documentation is a great tool for understanding object model. Once you got the main concept of hierarchy between objects, accessing objects is quite a child game.
    I am not meaning scripting is easy but have a look on the documentation, it's a essential starting point. I bought too the Peter Karhel's guide
    http://oreilly.com/catalog/9780596528171/index.html
    it's really cheap regarding to the quality of the learning.
    Welcome in this world.
    BTW, masterspreads is a property of document. So you should work with something like :
    app.activeDocument.masterSpreads[0].xxx
    Loic

  • Opening OA page in new java script window from ProcessRequest method

    I wish to open new OA page in new java script window.
    Code is
    javascript:var help_win = window.open(strHelpDesk,'help_win',
    'resizable=yes,scrollbars=yes,toolbar=yes,width=600,height=500'); help_win.focus();
    strHelpDesk is the url of the requested new OA page .. How can we open that page in new window from processRequest .. I can't assign this code in pages's attribute ... The new Oa page should be opened whenever , control goes in Processrequest ... Do we have such command ? can we use pagecontext.redirectImmediately..or any other command ..
    thx in advance

    Yes, you can, what you need to do is
    add a raw text bean in your page.
    Attach this raw text bean to a transient attribute (column) of VO
    populate this column with your javascript function which will open a new window and inlcude its call here
    now whenyour page will render and process request is called ur javascript function is triggered and a new window will be opened.I guess i am clear!
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I have to new version of FireFox and it doesn't allow me to use my Go daddy Email account. Go daddy said this is a beta version, so its not reading Go daddy's java script

    This new version of FireFox is in beta. I cannot send email with my Go Daddy web based email service. Go daddy tech support says this FireFox in beta is not reading Go Daddy's java script. That why I cannot send email with FireFox. Can I install the older version back. If so how?

    Hmmm, Norton extensions are broken again in Firefox 4.0.1. It seems that Norton didn't allow for Firefox 4.0 security updates when they updated their Firefox extension for Firefox 4.0. Norton says they'll have a fix in two weeks. A Norton user posted a fix in this forum thread.
    http://community.norton.com/t5/Norton-Internet-Security-Norton/Norton-Toolbar-not-compatible-with-FF-4-0-1/td-p/442788

Maybe you are looking for