Hongmu Notes
Home Language Notes JavaScript

JavaScript

Introduction: js generally refers to JavaScript. JavaScript ("JS" for short) is a lightweight, interpreted or just-in-time compiled programming language with function priority. Although it is famous as a scripting language for developing Web pages, it is also used in many non-browser environments. JavaScript is a dynamic scripting language based on prototype programming and multi-paradigm.

jQuery uses Ajax to submit messages and forms without refreshing

jQuery uses Ajax to submit messages and forms without refreshing Language Notes JavaScript

PbootCMS itself will return Json data when submitting using ajax request, so we can implement ajax submission without using API, and customize page prompts to improve user experience.   1. Message form <form onsubmit="return submsg(this);&q…
👁 131
Small problems with jquery each and splicing

Small problems with jquery each and splicing Language Notes JavaScript

Selector + traversal $('div').each(function (i){   i is the index value   this means traversing each dom object }); $('div').each(function (index,domEle){   index is the index...
👁 146
jquery common codes

jquery common codes Language Notes JavaScript

Hover event: <script>     $(function () {     $(".pro_box a").hover(function(){      &nb…
👁 154
jquery screen size judgment

jquery screen size judgment Language Notes JavaScript

<script> $(function () { if($(window).width() <= 760){ $("#css").attr("href","./static/css/style_m.css"); } })…
👁 191
swiper displays in different ways on different screens

swiper displays in different ways on different screens Language Notes JavaScript

breakpoints: { 320: { //When the screen width is greater than or equal to 320 slidesPerView: 2, slidesPerGroup: 2, spaceBetween: 50 }, 1000: { //When the screen width is greater than or equal to 768 slidesPerView: 3, slidesPerGroup:…
👁 151
js move the mouse up to modify the style attribute

js move the mouse up to modify the style attribute Language Notes JavaScript

When the mouse hovers over the element, the color changes to red; when the mouse leaves the element, the color changes to black. To retrieve an element by its ID: `document.getElementById()`; Event handler for mouse hover: `onmouseover`; Event handler for mouse leave: `onmouseout`.<!DOCTYPE html><html lang= "en">...
👁 130
js determines whether the mobile terminal and PC terminal jump to different pages

js determines whether the mobile terminal and PC terminal jump to different pages Language Notes JavaScript

Method 1: /* * * Determine whether the device is a PC or a WAP device */ var mobile_bs = {versions: function() {var u = navigator.userAgent; return {trident: u.indexOf('Trident')> -1, // IE kernel...
👁 224
How to refresh the verification code when clicking on it

How to refresh the verification code when clicking on it Language Notes JavaScript

Generally implemented through js, just reload the value of src<img src="index.php?p=back&c=Admin&a=captcha" onclick="this.src=this.src+'&k='+Math.random();"/…
👁 171
window.open() displays the window in the center

window.open() displays the window in the center Language Notes JavaScript

var iWidth = 400; //弹出窗口的宽度; var iHeight = 450; //弹出窗口的高度; var iTop = (window.screen.height-30-iHeight)/2; //获得窗口的垂直位置; var iLeft = (window.screen.wi...
👁 293
Click to expand the menu js code on the mobile side

Click to expand the menu js code on the mobile side Language Notes JavaScript

HTML code: <div class= "menu" > <i></i> <i></i> <i></i> </div> CSS code:.hdCon.menu {width: 40px; border...
👁 173
1 2 3 4