Select to view content in your preferred language

Cycle through different Home Page Images based upon Login or Group Membership

3469
0
08-10-2014 06:05 PM
ChristopherBrown4
Deactivated User

I have been investigating cycling through different Home Page Images based upon Login or Group Membership. I have found a HTML native rotator and was looking at it but have not had much success. I was hoping someone else may have tried this?

The Rotator Script Looks like this

var current = 0;

    var rotator_obj = null;

    var images_array = new Array();

    images_array[0] = "rotator_1";

    images_array[1] = "rotator_2";

    images_array[2] = "rotator_3";

    var rotate_them = setInterval(function(){rotating()},4000);

    function rotating(){

        rotator_obj = document.getElementById(images_array[current]);

        if(current != 0) {

            var rotator_obj_pass = document.getElementById(images_array[current-1]);

            rotator_obj_pass.style.left = "-960px";

        }

        else {

            rotator_obj.style.left = "-960px";

        }

        var slideit = setInterval(function(){change_position(rotator_obj)},30);

        current++;

        if (current == images_array.length+1) {

            var rotator_obj_passed = document.getElementById(images_array[current-2]);

            rotator_obj_passed.style.left = "-960px";

            current = 0;

            rotating();

        }

    }

    function change_position(rotator_obj, type) {

        var intleft = parseInt(rotator_obj.style.left);

        if (intleft != 0) {

            rotator_obj.style.left = intleft + 32 + "px";

        }

        else if (intleft == 0) {

            clearInterval(slideit);

        }

    }

0 Kudos
0 Replies