Home > Web Front-end > JS Tutorial > body text

Mui uses jquery and uses click to jump to a new window example sharing

小云云
Release: 2017-12-30 15:21:13
Original
1897 people have browsed it

This article mainly brings you an example of Mui using jquery and clicking to jump to a new window. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.

The js code is inserted globally


mui('body').on('tap', 'a', function () { document.location.href = this.href; });
Copy after login

This works, but there are many problems, such as when clicking on the sidebar , it does not appear, there are many errors,

After practicing my method, it is still feasible. After writing too much jquery, debugging native js always fails. Maybe it’s because I’m unfamiliar, but I still need to use everything~

Then add jquery


@Scripts.Render("~/bundles/jquery")
Copy after login

Okay, just add the code :

id jump:


$('#Message').on("tap", function () {
  //打开关于页面
  mui.openWindow({
    url: '../Home/About',
    id: &#39;About&#39; <br>});
Copy after login

9 Palace jump:


$(&#39;.mui-grid-9&#39;).on("tap", &#39;a&#39;, function () {
    var url = $(this).attr(&#39;href&#39;);
    //打开关于页面
    mui.openWindow({
      url: url,
      id: &#39;info&#39;
    });
  });
Copy after login

Picture carousel jump:


##

$(&#39;#slider&#39;).on("tap", &#39;a&#39;,function () {
    var url = $(this).attr(&#39;href&#39;);
    //打开关于页面
    mui.openWindow({
      url: url,
      id: &#39;info&#39;
    });
  });
Copy after login
Related recommendations:


Example details the encapsulation process of mui pull-up to load more pull-down refresh data

JS realizes the transparent gradient effect of MUI navigation bar

How to use the MUI framework in mobile HTML5

The above is the detailed content of Mui uses jquery and uses click to jump to a new window example sharing. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!