Home > Web Front-end > HTML Tutorial > How to make the entire div hyperlinked (you need to use the tag)_html/css_WEB-ITnose

How to make the entire div hyperlinked (you need to use the tag)_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:03:48
Original
1657 people have browsed it

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-->
Copy after login

My div structure is as above. To link the school_back div with the full inclusion, how should I add the a tag?


Reply to the discussion (solution)

Try

onclick="$.mobile.changePage('#pagetwo');"
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template