How to cycle between 2 div inside 1 div
-
I need cycle with two divs inside 1 div.
I try plugin “Head & Footer Core”
I have inside “Head Code” (on this subpage=”Home”) for this plugin
<code> <div class="container"> <div class="content1" id="pf1">aaaaaaaaaaaaaaaaa</div> </div> <div class="container"> <div class="content2" id="pf2">bbbbbbbbbbbbbbbbbbbbbb</div> </div> <script> function 2divy(){ var Heads = document.getElementById('insert_here'), cycle; var Headsy= [{document.getElementById('pf1')}, {document.getElementById('pf2')}]; Heads.onmouseover = function(){ clearInterval(cycle); } Heads.onmouseout = function(){ cycle = setInterval(function(){ var i = Headsy[i=(Headsy.push(Headsy.shift())-1)]; },3000); } Heads.onmouseout(); } window.onload = function(){ 2divy(); } </script> </code>
And on subpage “Home” i have:
<html> <h2>Informacja</h2> <div class="panel panel-default mini3" id="insert_here"></div> <div class="kafw5 kafw5-992" style="text-align: center;"> </div> </div> </html>
I need cycled this two div inside “home” where is “insert_here”
But those two divs appear on the top of page “Home” before header and nothing is not cycled.
I am not experienced in javascript, can anyone help me with this?
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to cycle between 2 div inside 1 div’ is closed to new replies.