2013-04-11 77 views
0

我使用http://boedesign.com/blog/2008/06/08/imagetick-for-jquery/來設置複選框的樣式。我的DIV結構是這樣的:自定義樣式的複選框不加載動態加載內容的樣式

<table> 
    <thead> 
    <tr> 
    <th>Check1</th> 
    <th>Check2</th> 
    <th>Name</th> 
    </tr> 
    </thead> 

    <tbody> 
    <tr> 
    <td><input class="accept" type="checkbox" value="check_1" name="accept_1" id="accept1"></td> 

    <td><input class="process" type="checkbox" value="check_2" name="process_1" id="process1"></td> 
    <td>donald</td> 
    </tr> 
    </tbody> 
    </table> 

在我的jQuery:

​​

我將通過.load加載表的內容()方法。但複選框沒有與圖像樣式。它僅在首次加載頁面時顯示圖像。之後,現在顯示。我怎樣才能解決這個問題?

回答

0

你需要打電話給你的插件在.load回調函數:

$('#your_item').load(title, function(){ 
    $("input[name='accept_1']").imageTick({ 
     tick_image_path: { check_1: "/public/images/checkbox_full.png"}, 
     no_tick_image_path: { check_1: "/public/images/checkbox_empty.png"}, 
     image_tick_class: "accept_1", 
    }); 

    $("input[name='process_1']").imageTick({ 
     tick_image_path: { check_1: "/public/images/checkbox_full.png"}, 
     no_tick_image_path: { check_1: "/public/images/checkbox_empty.png"}, 
     image_tick_class: "process_1", 
    }); 
}); 
+0

謝謝..它的工作.. – Rajeswari 2013-04-11 09:16:17