Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-03-2011 18:32:12

messagerra
Member
Registered: 06-05-2008
Posts: 14

Ads Banner - Jumping on a Top of the Page

Hi

I'm adding some ads on web site currently and use banner rotator as well. But I noticed one weird thing: each time I refresh page, the top of the shop kind of 'jumping', like resizing all the time it's height.

Could anyone look at wwwshineandspark.com and tell me how to fix this 'jumping' effect on a page?

P.S. To place these banners on top I used the following java script, in head of the skin.php file:


<center>

<script language="Javascript">
<!--
// original content taken from Nic's JavaScript Page with permission
// lack of these three lines will result in copyright infringment
// made by: Nic's JavaScript Page - http://www.javascript-page.com

var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

link = new initArray(
"http://www.aa.com/",
"http://www.bb.com/",
"http://www.cc.net/"
);

image = new initArray(
"http://www.aa.com/image",
"http://www.bb.com/image",
"http://www.cc.com/image","
);

text = new initArray(
"aa",
"bb",
"cc"
);

var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink  = link[core];
var ranimage = image[core];
var rantext  = text[core];

document.write('<a href=\"' +ranlink+ '\" target="_blank" ><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');

//-->


</SCRIPT>

</center>


</head>

Offline

 

#2 04-03-2011 18:49:38

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Ads Banner - Jumping on a Top of the Page

Looks like the banners are different sizes causing the layout to have to be redone every time a new one gets loaded.

Offline

 

#3 04-04-2011 04:28:03

messagerra
Member
Registered: 06-05-2008
Posts: 14

Re: Ads Banner - Jumping on a Top of the Page

Dave wrote:

Looks like the banners are different sizes causing the layout to have to be redone every time a new one gets loaded.

I've checked all banners today. I've brought all of them to 468x60 size and deleted the bottom ads as well (just in case).

The same 'jumping' is still there....


May be there is a way to fix a specific size on top ?

Last edited by messagerra (04-04-2011 06:11:50)

Offline

 

#4 04-04-2011 06:51:17

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Ads Banner - Jumping on a Top of the Page

There are several markup errors which are making the page invalid which may be contributing to the problem. The JS you are using is also writing the banner in the head section of the document which is not a valid place to have that image and link. I would correct the errors and get the banner positioned correctly in the document. Specifying the size of the image should certainly help as it gives the rendering engine precise information that may be used when laying out the page.

Offline

 

#5 04-04-2011 08:13:58

messagerra
Member
Registered: 06-05-2008
Posts: 14

Re: Ads Banner - Jumping on a Top of the Page

Dave wrote:

There are several markup errors which are making the page invalid which may be contributing to the problem. The JS you are using is also writing the banner in the head section of the document which is not a valid place to have that image and link. I would correct the errors and get the banner positioned correctly in the document. Specifying the size of the image should certainly help as it gives the rendering engine precise information that may be used when laying out the page.

Hi, Dave

Thanks a lot, but I have to say that I'm an absolute dummy in this...

Where do I need to place it in skin.php? What kind of errors I need to correct? I'm also not good with java... I just found this script on a web and used it. That's all that I can do by myself... For instance, I don't know where to put picture size in this script...

Offline

 

#6 04-04-2011 08:20:32

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Ads Banner - Jumping on a Top of the Page

messagerra wrote:

Where do I need to place it in skin.php?

Since the JS appears to be blindly writing a link with an image you'll probably want to put it into its own <div> somewhere after the body statement. I can't tell you exactly where because we can't see your skin file.

messagerra wrote:

What kind of errors I need to correct?

The  is your friend and shows you what the errors are and offers clues on what you need to do to fix things.

messagerra wrote:

I'm also not good with java... I just found this script on a web and used it.

You are not using Java, it is JavaScript ... MAJOR difference.

messagerra wrote:

For instance, I don't know where to put picture size in this script...

You would need to add height and width parameters to the <img> tag that the JS is writing.

Offline

 

Board footer