$(function () { vari = 1; $("Div. Datapartfull "). each (function(index, Element) {varIndexID = $element). Find ("input[type= ' hidden ']"). EQ (0). Val (); varSetype = $ (Element). Find ("input[type= ' hidden ')"). EQ (1). Val ();//Line chart or bar chart //if the Setype in the database is empty, the default is bar chart if(Setype = =NULL|| Setype = = "") Setype = "Bar"; varMyChart = Echarts.init (document.getElementById ("main" +IndexID), theme[i]); mychart.setoption (option); Getajaxchartdata (IndexID, MyChart, Setype); I++; }); varFirstindexid = $ ("#ctl00_ContentPlaceHolder1_hidIndexid"). Val (); varFirstsetype = $ ("#ctl00_ContentPlaceHolder1_hidSertype"). Val (); if(Firstsetype = =NULL|| firstsetype== "") Firstsetype = "Bar"; if(Firstindexid! =NULL) { varMyChart = Echarts.init (document.getElementById ("main" + Firstindexid), theme[0]); mychart.setoption (option); Getajaxchartdata (Firstindexid, MyChart, Firstsetype); } });
function Getxian (Strshi) { $ ("#ShiList a"). Removeclass ("cur"); $ ("#ShiList a"). each (thefunction (index, Element) {if ($(this). attr ( "id") = = "Shi" + Strshi) { $ (this). AddClass ("cur");} ); }
The above two instances are a way to loop multiple objects with the same characteristics under a DIV and perform related operations
jquery gets all objects of the same attribute under a div to loop on its action