Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > RocketCake
Issues with banner-rotation script

ajac73
Registered User
Quote
2022-05-11 14:00:55

I've been testing a banner-rotation script that is part html and part js.
The html part goes after the <body> tag and the js part goes just before the </body> tag, however I'm having the following issues that I need to resolve.
Using 'View--Html Code of Page--Additional attributes in body' doesn't work because the RC editor doesn't allow me to paste the js code before the </body> tag, so I can only do this externally using Notepad or similar (and then the banner rotation works), but this of course is no good because if I then want to edit the page via RC, all of that code is removed. So how can I place the js code where I want to place it before the </body> tag using the RC editor?
The other issues I'm having is that the images are not displayed exactly central within the container (they're slightly offset to the right) and the message 'Undefined' is displayed after the last image/banner.

Thanks if anyone can help.


erik
Registered User
Quote
2022-05-11 15:18:54

You can just create a HTML Code or JavaSCript Code element. Place it somewhere on your page (probably on the very bottom) and uncheck the "Create Div around element" option.

Double click it and paste your code into there. (With script tags if it you use a HTML Code, without if you your JavaScript code element)


ajac73
Registered User
Quote
2022-05-11 21:00:04

Ok, placing a code element at the very bottom of the page and pasting the JavaScript into there worked! Thank you very much for the suggestion! :) However I still have the problem of images not being centred (they're still slightly offset to the right) and the message 'Undefined' is still displayed after the last image.


erik
Registered User
Quote
2022-05-12 12:24:27

Difficult to say without seeing it, that seems likely to be caused by that banner you are using.


ajac73
Registered User
Quote
2022-05-13 01:53:01

Thanks again for helping. Turns out that the default cell padding values of 10 was the reason. They're now set to 0 and the images now centre exactly.
I'm still getting the 'Undefined' message though after the last image is shown, but I think that's something to do with the script.


ajac73
Registered User
Quote
2022-05-13 04:56:18

Turns out the count value in the JS code was set to 6, but there were only 5 images/banners, so I just reset the count value. Now everything's fine :)


erik
Registered User
Quote
2022-05-13 14:35:49

Ah, thanks for the update. Nice!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact