Home  >  Article  >  Web Front-end  >  Mui uses jquery and uses click to jump to a new window example sharing

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

小云云
小云云Original
2017-12-30 15:21:131885browse

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; });

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")

Okay, just add the code :

id jump:


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

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;
    });
  });

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;
    });
  });

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!

Statement:
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