Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Q2A Core by

I want to add some modification and it requred javascript function to work but don't know where to add this javascirpt pl suggest


var containerheight = 0;
var numbercount = 0;
var liheight;
var index = 1;

function callticker() {    
    $(".container ul").animate({
        "margin-top": (-1) * (liheight * index)
    }, 2500);
    if (index != numbercount - 1) {
        index = index + 1;
    else {
        index = 0;
    timer = setTimeout("callticker()", 100);
$(document).ready(function() {
    numbercount = $(".container ul li").size();
    liheight = $(".container ul li").outerHeight();
    containerheight = $(".container ul  li").outerHeight() * numbercount;
    $(".container ul").css("height", containerheight);
    var timer = setTimeout("callticker()", 100);

2 Answers

+2 votes
by using the layers you can perform such operations -


follow up with the instructions and examples here -

+2 votes

You can modify your qa-theme.php this way:

function doctype() {
   $script = <<<JS
   $this->content['body_footer'] = (isset($this->content['body_footer']) ? $this->content['body_footer'] : '') . $script;

Respect the spacing in <<<JS and JS;.
If this shows the alert then this is working. You should now replace alert("hello"); with the given JS code. After that, it is a matter of making your JS code work :)
Thats great . It is also a Good Idea .
There are indeed a few more alternatives. EG: You can also add it in the head tag. I personally like the plugin idea more but the user will have to know how to create a plugin. Not hard but still more complex than what the average user expects.
Thanks a lot for the tip :)