문제

problem: trigger errored when block UI is called on this code

(function($){

    function preloader()
    {
        $('a#preloader').click(function(e){
           e.preventDefault();
           var url = base_url + 'runtest/preloader';

           $('div#content').load(url, preloaderCallback);
        });
    }

    function remotePreload()
    {
        $('a#remotepreload').click(function(e){
           e.preventDefault();

           var object = $(this);
           object.data('clicked', 'yes');

           var url = base_url + 'runtest/remote_preloader';

           $('div#content').load(url);
        });
    }


    /*
     * callback functions
     */

    function preloaderCallback()
    {
        $('div.imageholder img').hide();

        $('div.imageholder img').each(function(){
            var img = new Image();

            var sursa = $(this).attr('src');

            var parent = $(this).parent();

            var preloaderSource = '<img src="' + base_url + 'media/images/preloader.gif' + '" alt="loader"/>';

            parent.append(preloaderSource);

            $(img).load(function(){
                parent.append($(this));
                $(this).hide().fadeIn(500);
                $(this).siblings().remove();
            }).attr('src', sursa);
        });
    }

    function blocker()
    {
        $('#content').block();
    }

    function handlePageLoad()
    {
        $('a#remotepreload').ajaxStart(function(e){
            var elem = $(e.target);
            if (elem.data('clicked') == 'yes')
            {
                // error when blocker() function is called here
                alert('Started');
            }
        });
        $('a#remotepreload').ajaxComplete(function(e){
            var elem = $(e.target);
            if (elem.data('clicked') == 'yes')
            {

                elem.removeData('clicked');
                alert('Ended');
            }
        });
    }

    // call onready functions
    $(function(){
        preloader(); remotePreload();handlePageLoad();
    });
})(jQuery);

// here's the error from firefox's debugger uncaught exception: [Exception... "Could not convert JavaScript argument arg 0" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://localhost/testsuite/media/js/jquery.min.js :: anonymous :: line 115" data: no]

here's the html markup

<div id="wrap">
            <div id="header">
                <?= $header ?>
            </div>

            <div id="content">
                <?= $content ?>
            </div>

            <div id="sidebar">
                <?= $sidebar ?>
            </div>

            <div id="footer">
                <?= $footer ?>
            </div>
        </div>

EDIT I was using Jquery 1.4.1 when this happened. Switched back to 1.3 and everything went back to normal.

도움이 되었습니까?

해결책

참조하는 모든 아이콘은 단일 파일에 저장됩니다. 소위 스프라이트 이미지. 이 기사에서 작동하는 방식 -> CSS Sprites : 그들이 무엇인지, 왜 ' 시원하고, 사용 방법

SharePoint의 이미지는 SharePoint의 레이아웃 폴더에 저장됩니다. 즉,이 파일을 편집하거나 변경하면 안됩니다. Microsoft Update로 덮어 쓸 수 있습니다. 이 이미지가 포함 된 파일 이름은 spCommon.png입니다.

표시되는 아이콘을 변경하려면 일부 CSS 마법을 수행해야합니다. 먼저 원본 이미지를 숨기고 새 배경 이미지를 눌러 요소에 할당하십시오.

다음 코드는 원래 아이콘을 숨 깁니다. 부모 요소의 배경색을 빨간색으로 바꿉니다. 나는이 배경색을 사용하여 CSS 효율 영역을 강조 표시합니다. 또한 배경 이미지 속성을 추가합니다. 이러한 속성은 새 이미지로 변경해야합니다. 사이트 모음이나 팜 내의 파일에 대한 경로를 추가해야합니다. URL () 값 안에 이미지의 경로를 삽입하십시오. 나는 당신을위한 자리 표시 자 경로를 추가했습니다.

다음 이미지는 코드 타격에 의해 수행되는 것을 보여줍니다.

아래 코드가 아래 코드를 보여줍니다

이 코드가 해당 코드입니다.

/* Hide icon of shareing button */
#ctl00_ctl52_site_share_button .ms-promotedActionButton-icon img {
   display: none;
}

/* give share a new icon */
#ctl00_ctl52_site_share_button .ms-promotedActionButton-icon {
   background-color: red;
   background-image: url('path_to_your/customshareimage.png');
}

/* hide icon of follow button */
#site_follow_button .ms-promotedActionButton-icon img {
    display: none;
}

/* give follow a new icon */
#site_follow_button .ms-promotedActionButton-icon {
    background-color: red;
    background-image: url('path_to_your/customfollowimage.png');
}
.

은 일할 수 있습니다. 예.

를 사용하는 것이 좋습니다. 아니, 어디에서나 그것을 브랜드해야하기 때문에. MySite, 모든 팀 사이트 및 하위 페이지에서. 이것은 확실히 마스터 페이지와 CSS에 의해 수행 될 수 있지만 사용자가 사용자 정의되지 않은 사이트를 히는 경우 아이콘이 어떻게 다른지 궁금해 할 것입니다. 사용 성 관점에서 기본 아이콘을 변경하지 않는 것이 좋습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top