Technical support This forum is closed.
Version 1.x > Technical support > scroller news View modes: 
User avatar
Member
Member
ramim@avital-insure.com - 1/30/2008 4:06:52 PM
   
scroller news
Hello,
I created a number pages of news.
In the homepage -

<cc1:queryrepeater id="QueryRepeater1" runat="server" queryname="cms.news.selectlatest" transformationname="cms.news.preview">
</cc1:queryrepeater>

Now I want that will run like scroller news
And will run all news .


User avatar
Member
Member
ramim@avital-insure.com - 1/31/2008 11:28:51 AM
   
RE:scroller news
I succeeded to create an Scroller news
But there is a problem when I click on the news the news.aspx opens inside the window and not inside new ASPX document

The code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsScrollerHeb.aspx.cs" Inherits="NewsScrollerHeb" %>
<%@ Register TagPrefix="cc3" Namespace="Kentico.CMS.DataEngine" Assembly="Kentico.CMS.DataEngine" %>
<%@ Register TagPrefix="cc2" Namespace="Kentico.CMS.TreeEngine" Assembly="Kentico.CMS.TreeEngine" %>
<%@ Register TagPrefix="cc1" Namespace="Kentico.CMS.CMSControls" Assembly="Kentico.CMS.CMSControls" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="HeaderHeb.ascx" %>

<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl" xml:lang="he" lang="he">

<head id="Head1" runat="server">
<%=WebProject.Functions.GetPageTags("/news")%>
<style type="text/css">
<!--
BODY { margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; }


/* FONT COLORS */


TABLE { COLOR: #000000; FONT: 11px arial, sans-serif; font-weight: normal }

.title { COLOR: #0033FF; FONT: 12px arial, sans-serif; font-weight: bold; }

#NewsDiv { position: absolute; left: 0; top: 0; width: 100% }

/* PAGE LINK COLORS */

a:link { color: #0033FF; text-decoration: underline; }

a:visited { color: #6633FF; text-decoration: underline; }

a:active { color: #0033FF; text-decoration: underline; }

a:hover { color: #6699FF; text-decoration: none; }

-->
</style>



</head>
<BODY BGCOLOR="#F0F0F0" TEXT="#000000" onMouseover="scrollspeed=0" onMouseout="scrollspeed=current" OnLoad="NewsScrollStart();">
<div align="center">
<form id="form1" method="post" runat="server">
<div class="MainPage">


</div>
<div id="NewsDiv">
<table cellpadding="5" cellspacing="0" border="0" width="100%"><tr><td>
<!-- SCROLLER CONTENT STARTS HERE -->


<span class="title">
<cc1:cmsrepeater id="CMSRepeater1" runat="server" selectnodesclassname="cms.news" selectnodespath="/newsheb/%"
selectnodesorderby="NewsReleaseDate DESC" selectnodespathtype="AliasPath" selecteditemtransformationname="cms.news.default"
transformationname="cms.news.preview">
</cc1:cmsrepeater>

<br><br><br>

<!-- SCROLLER CONTENT ENDS HERE -->

<script language="JavaScript" type="text/javascript">
<!-- HIDE CODE

var scrollspeed = "1" // SET SCROLLER SPEED 1 = SLOWEST
var speedjump = "30" // ADJUST SCROLL JUMPING = RANGE 20 TO 40
var startdelay = "2" // START SCROLLING DELAY IN SECONDS
var nextdelay = "0" // SECOND SCROLL DELAY IN SECONDS 0 = QUICKEST
var topspace = "2px" // TOP SPACING FIRST TIME SCROLLING
var frameheight = "200px" // IF YOU RESIZE THE WINDOW EDIT THIS HEIGHT TO MATCH



current = (scrollspeed)


function HeightData(){
AreaHeight=dataobj.offsetHeight
if (AreaHeight==0){
setTimeout("HeightData()",( startdelay * 1000 ))
}
else {
ScrollNewsDiv()
}}

function NewsScrollStart(){
dataobj=document.all? document.all.NewsDiv : document.getElementById("NewsDiv")
dataobj.style.top=topspace
setTimeout("HeightData()",( startdelay * 1000 ))
}

function ScrollNewsDiv(){
dataobj.style.top=parseInt(dataobj.style.top)-(scrollspeed)
if (parseInt(dataobj.style.top)<AreaHeight*(-1)) {
dataobj.style.top=frameheight
setTimeout("ScrollNewsDiv()",( nextdelay * 1000 ))
}
else {
setTimeout("ScrollNewsDiv()",speedjump)
}}



// END HIDE CODE -->
</script>


</form>
</div>
</body>
</html>

-------------------------------------------------------------------

And javascript file "NewsScor.js"


<!-- START


// SCROLLING NEWS FOR A .JS FILE

document.write('<div class="ContentNewsPadding">');
document.write('<table cellpadding="2" cellspacing="0" border="0" style="border: #000000 1px solid; background-color: #996666;COLOR: #FFFFFF; FONT: 13px arial, sans-serif; font-weight: bold;"><tr><td align="center">');
document.write('News<br>');
document.write('</td></tr><tr><td>');
document.write('<iframe id="NewsWindow" src="../NewsScrollerHeb.aspx" width="200" height="200" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="border: #000000 1px solid;"></iframe><br>');
document.write('</td></tr></table>');
document.write('</DIV>');

// -- END FILE -->