Hiển thị các bài đăng có nhãn jquery. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn jquery. Hiển thị tất cả bài đăng

Thứ Tư, 15 tháng 5, 2013

jquery masonry problem in chrome

讓container的圖片讀取完畢再做動作

$(function() {
$('#container').imagesLoaded(function() {
$('#container').masonry({
itemSelector : '.item',
columnWidth : 10
});
});
});


http://stackoverflow.com/questions/7476649/jquery-masonry-breaksstacks-images-in-chrome-safari-but-only-on-first-load

Thứ Ba, 13 tháng 11, 2012

jQuery ~ move Table tr

$(document).ready(function(){
$(".up,.down").click(function(){
var row = $(this).parents("tr:first");
if ($(this).is(".up")) {
row.insertBefore(row.prev());
} else {
row.insertAfter(row.next());
}
});
});


reference
http://stackoverflow.com/questions/1569889/jquery-move-table-row

Chủ Nhật, 19 tháng 8, 2012

解決Discuz和jQuery的衝突~

我是用人家的解決方法1

将jquery.js在common.js之前载入,不然jquery的$()函数会覆盖common.js的$()函数;然后用到jQuery的$()函数的地方都用jQuery()代替。

不過我是用$jq代替= =

var $jq = jQuery;


http://witmax.cn/discuz-jquery-conflict.html

Thứ Ba, 3 tháng 7, 2012

jQuery Flot ~ set Label example


var d1 = [];
d1.push([1, 1234]);
d1.push([2, 5678]);

var stack = 0, bars = true, lines = false, steps = false;
$.plot($("#statisticsGraph"), [d1], {
series: {
lines: { show: lines, fill: true },
bars: { show: bars, barWidth: 0.8 }
}, xaxis: {
ticks: [[1, 'out hospital'], [2, 'in hospital']]
}
});


reference
http://stackoverflow.com/questions/459947/how-do-i-control-the-tick-label-size-in-flot

Thứ Hai, 2 tháng 7, 2012

jQuery Flot ~ Invalid dimensions for plot

Invalid dimensions for plot, width = 893, height = 0

假如要用jQuery Flot 產生圖表

出現這問題是因為

沒有設定到指定畫圖表物件的高跟寬

加上css設定下就OK~

#statisticsResult{
height:300px;
width:300px;
}

Thứ Tư, 14 tháng 9, 2011