locked
Sharepoint Menus like SiteActions are automatically closing before selecting option. RRS feed

  • Question

  • Hi,

           I am using window.settimeout(x) method for a spotlight webpart to scroll images with frequent interval of time. But the problem is when i open any menu on sharepoint page for ex: siteaction it automatically closes when the interval of spotlight reached or when image changes.

     

    Please help how to avoid this auto closing. Please find the code below which i am using.

     

     

    var scrollBlock = 0; 

    window.setTimeout(getNextImage, 5000);

     

     

    function getNextImage() {

     

        var items = $(".items img");

        var selectIndex = 0;    // use this to select what image to select

     

        // find the currently selected image

        for (var i = 0; i < items.length; i++) {

     

            var item = items[i];

            if ($(item).hasClass("active")) {

                selectIndex = i + 1;    // set the index for the next image

                break;

            }

        }

    Please help thanks in advance!!!

    Wednesday, February 16, 2011 4:08 PM

Answers

  • Use jQuery to have your refresh only affect your field:

    window.setInterval(function, 10000);

    function blah()

    {

    $(".active > img").attr("src").replace("/image/path.ext");

    }


    SharePoint 2010 Extensions - http://sp2010ext.codeplex.com/ My Blog - http://www.withinsharepoint.com Twitter - http://twitter.com/#!/withnsharepoint
    • Proposed as answer by Gary.Newman MCT Wednesday, February 16, 2011 9:19 PM
    • Marked as answer by Seven M Wednesday, February 23, 2011 5:08 AM
    Wednesday, February 16, 2011 8:33 PM

All replies

  • NEVER waste all of our time by posting the same question to two different forums at the same time.

    I have (as Moderator there) deleted the identical post you made to the pre-SP 2010 design and customization forum.

    Do not do this again. Decide if you are asking about SP 2010 or about a pre-2010 SP product and post ONLY to the single forum for that product and question.

    Moderator pre-SP 2010 forums


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Wednesday, February 16, 2011 8:15 PM
  • Use jQuery to have your refresh only affect your field:

    window.setInterval(function, 10000);

    function blah()

    {

    $(".active > img").attr("src").replace("/image/path.ext");

    }


    SharePoint 2010 Extensions - http://sp2010ext.codeplex.com/ My Blog - http://www.withinsharepoint.com Twitter - http://twitter.com/#!/withnsharepoint
    • Proposed as answer by Gary.Newman MCT Wednesday, February 16, 2011 9:19 PM
    • Marked as answer by Seven M Wednesday, February 23, 2011 5:08 AM
    Wednesday, February 16, 2011 8:33 PM
  • Sorry for inconvinience.
    Friday, February 18, 2011 9:32 PM