对于动态添加的元素(Firefox除外),滚动条不会触发Mouseup:
CSS:
#dBox {
height: 100px;
width: 230px;
overflow - y: auto;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<input type="text" id="s">
JQuery的:
$(function() {
$('#s').focus(function() {
var $dbox = $('<ul id="dBox"></ul>');
for (i = 0; i < 10; i++) $dbox.append('<li>' + i + '</li>');
$(this).after($dbox);
$dbox.bind("mouseup", function() {
alert('in: ');
//console.log ('in: ');
});
});
});
// OR LIKE THIS
$('#s').focus(function() {
var $dbox = $('<ul id="dBox"></ul>');
for (i = 0; i < 10; i++) $dbox.append('<li>' + i + '</li>');
$(this).after($dbox);
});
$('#dBox').live("mouseup", function() …Run Code Online (Sandbox Code Playgroud) $s = explode (" ", microtime());
$s = $s[0]+$s[1];
$con = mysqli_connect ('localhost', 'test', 'pass', 'db') or die('Err');
for ($i=0; $i<1000; $i++) {
$stmt = $con -> prepare( " SELECT MAX(id) AS max_id , MIN(id) AS min_id FROM tb ");
$stmt -> execute();
$stmt->bind_result($M,$m);
$stmt->free_result();
$rand = mt_rand( $m , $M ).'<br/>';
$res = $con -> prepare( " SELECT * FROM tb WHERE id >= ? LIMIT 0,1 ");
$res -> bind_param("s", $rand);
$res -> execute();
$res->free_result();
}
$e = …Run Code Online (Sandbox Code Playgroud) 如果可行,我如何获取两个结果集:
$sth=$dbh->prepare("SELECT * FROM tb1 WHERE cond1;
SELECT * from tb2 Where cond2");
$sth->execute();
$row=$sth->fetchAll(); print_r ($row);
Run Code Online (Sandbox Code Playgroud)
这是两个完全不同的表(没有共同的fiels).