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: 'About' <br>});
9 Palace jump:
$('.mui-grid-9').on("tap", 'a', function () { var url = $(this).attr('href'); //打开关于页面 mui.openWindow({ url: url, id: 'info' }); });
Picture carousel jump:
##
$('#slider').on("tap", 'a',function () { var url = $(this).attr('href'); //打开关于页面 mui.openWindow({ url: url, id: 'info' }); });
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!