The dom of jq's ajax append has no style after using the TouchSlide plug-in

jq"s ajax append after using the TouchSlide plug-in causes the class defined by TouchSlide to have no style

now it"s like this clipboard.png


clipboard.png

width0px
bdclass

ajax
clipboard.png

clipboard.png

Mar.02,2021

clipboard.png

two scenarios
scenario one
do not need $('.bd') .append (html)
add dom with the append method of the generated TouchSlider object (dom is not html)
scenario two
$('.bd') .append (html)
then call the refresh method of the TouchSlider object


has not used TouchSlide. However, this is generally due to the fact that the later inserted HTML is not inserted into the DOM, so there is no width or height when it is taken out, so width:0px . The solution can be added to the Slide by calling JS after the entire HTML is rendered, that is, using setTimeout to operate on the next stack.

addHTML();
setTimeout(addToSlide, 0);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31c64-2bdcc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31c64-2bdcc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?