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 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    News Ticker Problem #2

    Hi,

    Sorry, I'm still struggling with this damn ticker thingy

    My problem now, is that after the first cycle, the news loses the spacing between the seperate items and appears as one crunched up mess.

    The ticker source is from this site:
    http://www.sharepointcustomization.c...er/default.htm

    And they recommend
    Separators
    Probably the easiest way to insert separators, like horizontal rules or images, between the news items, would be to append the HTML to display the separator to the news items HTML itself. This can easily be done in the NewsScroller_RenderChildren() function in the newsscroller.js source file.

    Which to be honest has had me flummoxed.

    Heres the portion of code they are talking about - can anyone make sense of it?


    Code:
    // Supporting functions
    function NewsScroller_RenderChildren()
    {
    	var sControlID = this.renderedControl;
    	elmControl = document.getElementById(sControlID);
    	
    	// <DIV>
    	elmDiv = document.createElement("div");
    	elmDiv.style.position = "absolute";
    	elmDiv.style.left = "0px";
    	elmDiv.style.width = "100%";
    	elmDiv.style.height = "100%";
    	elmDiv.style.overflow = "hidden";
    	elmControl.appendChild(elmDiv);
    	
    	for (var nItem = 0; nItem < this.itemCount; nItem++)
    		{
    		var sItemName = sControlID + nItem.toString();
    		
    		var elmP = document.createElement("p");
    		elmP.id = sItemName;
    		elmP.style.position = "relative";
    		elmP.style.top = "0px";
    		elmP.style.width = "100%";
    		elmP.className = this.itemNormalClassName;
    		elmDiv.appendChild(elmP);
    		
    		var elmA = document.createElement("a");
    		elmA.className = this.itemNormalClassName;
    		elmA.href = this.itemsLink[nItem];
    		elmP.appendChild(elmA);
    		
    		var tn = document.createTextNode(this.itemsText[nItem]);
    		elmA.appendChild(tn);
    		
    		}
    }

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    ...
    var tn = document.createTextNode(this.itemsText[nItem]);
    elmA.appendChild(tn);
    var oHr = document.createElement('hr');
    elmA.appendChild(oHr);

    }
    }
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    Apr 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you


  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    following the pattern you may create&append whichever element you want. See also DOM methods.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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