1024programmer Java Under javascript-thinkphp, how to obtain one of the results output by template traversal in js?

Under javascript-thinkphp, how to obtain one of the results output by template traversal in js?


 
     
 

How to realize that when the mouse moves to the volist traversal output dataSet picture, the mainPic above the volist is replaced with the picture that the mouse has moved?
The pictures in volist that I get using JS are always the src of the first picture in the dataSet.

Reply content:


 
     
 

How to realize that when the mouse moves to the volist traversal output dataSet picture, the mainPic above the volist is replaced with the picture that the mouse has moved?
The pictures in volist that I get using JS are always the src of the first picture in the dataSet.

Create a new array, push the elements of your dataSet collection into this array in a loop, and then get any element you want from this array.
Not much to say, let’s get straight to the code

var arr = [];
 
     arr.push({"key1":"{$vi.key1}","key2":"{$vi.key2}",...});
 

 //arr is a js array, you can use it however you want

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/under-javascript-thinkphp-how-to-obtain-one-of-the-results-output-by-template-traversal-in-js-2/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索