I made a page on a mobile phone, accessed by WeChat’s built-in browser, and used jQuery mobile to design pageone and pagetwo for page switching.
http://www.w3cschool.cc/try/try.php?filename=tryjqmob_trans_slide
Question: I want to switch pages by clicking on a div, write You can use window.location.href in onclick to jump on the page, but you can't use the built-in browser of WeChat on your mobile phone. Page switching can only be achieved using a href.
<div class="school_back" onclick="location.href='#pagetwo';"> <!-- 5--> <div class="school_back_inner"> <div class="school_bakc_box"> <div class="school_img"> <img src="imgs"/> </div> </div> </div> <br> <a href="#pagetwo" class="btn btn-primary btn-block btn-large"><font size="+5" color="#000000"></font></a> </div> <!-- 5-->
Try
onclick="$.mobile.changePage('#pagetwo');"
Thank you for your writing, It's what I want. I don’t know how to set the switching effect like this, but forget it, just use the default one.