我有一个变量,是一个字符串,在html中有div.并且我试图在其中包含一个从1开始并自动递增的数字,以便每个div按升序编号.
while ($row9 = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$catname9 = $row9["catname"];
$statusid9 = $row9["id"];
$i = 1;
Run Code Online (Sandbox Code Playgroud)
这是我的时间^^
这是我的字符串,我反复回应,直到它到达我的被调用的sql表vv的末尾
$list9 .= '<div id="each9" style="margin-top:3px" onclick="moveTo(\'.main\', '.$i.');"></div>
Run Code Online (Sandbox Code Playgroud)
然后我回应
<?php echo $list9; ?>
Run Code Online (Sandbox Code Playgroud)
那么如何制作第一个1然后第二个重复2和第三个重复3
我试图通过使用此代码在我的网页上定位一个地方
<div id="mover" onclick="moveTo(".main", 3);">erer</div>
Run Code Online (Sandbox Code Playgroud)
多数民众赞成我的按钮^^
这是我的功能vv
this.moveTo = function(el5, page_index) {
if (typeof el5 == "string") el5 = document.querySelector(el5);
var current = document.querySelector(settings.sectionContainer + ".active"),
next = document.querySelector(settings.sectionContainer + "[data-index='" + (page_index) + "']");
if(next) {
var next_index = next.dataset.index;
_removeClass(current, "active");
_addClass(next, "active");
_removeClass(document.querySelector(".onepage-pagination li a" + ".active"), "active");
_addClass(document.querySelector(".onepage-pagination li a" + "[data-index='" + (page_index) + "']"), "active");
body.className = body.className.replace(/\bviewing-page-\d.*?\b/g, '');
_addClass(body, "viewing-page-"+ next_index);
pos = ((page_index - 1) * 100) * -1;
if (history.replaceState && …Run Code Online (Sandbox Code Playgroud)