首页index.php中开始写如下代码:
<script type="text/javascript">
$(document).ready(function() {
$('img').jqPuzzle(); // apply to all images
});
</script>
※ body中加了个按钮,想调用jqPuzzle()修改IMG的属性,参数具体如下
◎以下是引用的JS中的一段代码:
$(document).ready(function() {
$('img.jqPuzzle').each(function() {
var microFormat = /\bjqp(-[a-z]{2})?-r(\d)-c(\d)(-h(\d+))?(-s(\d+))?(-[A-Z]+)?\b/;
var match = microFormat.exec(this.className);
var settings;
if(match) {
settings = {
rows: parseInt(match[2]),
cols: parseInt(match[3]),
hole: parseInt(match[5]) || null,
shuffle: match[8] && match[8].indexOf('S') != -1,
numbers: match[8] ? match[8].indexOf('N') == -1 : true,
language: match[1] && match[1].substring(1)
};
if(match[7]) {
settings.animation = {};
settings.animation.shuffleRounds = parseInt(match[7]);
}
if(match[8] && match[8].search(/[ABCDE]/) != -1) {
settings.control = {};
settings.control.shufflePieces = match[8].indexOf('A') == -1;
settings.control.toggleOriginal = match[8].indexOf('B') == -1;
settings.control.toggleNumbers = match[8].indexOf('C') == -1;
settings.control.counter = match[8].indexOf('D') == -1;
settings.control.timer = match[8].indexOf('E') == -1;
}
}
// call the plugin
$(this).jqPuzzle(settings);
});
});
---------------
现在的问题是:如果通过调用jqPuzzle(),修改参数settings呢?
<button onclick="jqPuzzle('jqp-fr-r4-c4-h5-NDE')">b1</button>
这样写不起作用,为什么呢
哥哥姐姐救救我!!!!!!!!非常感谢,急