search
HomeComputer TutorialsComputer KnowledgeHow to call assigned function in javascript

How to call assigned function in javascript

How to call function assignment in javascript

function show(n)

{

$('.lightBox').css({

"width":"400px",

"height":"180px"

});

$("#lightBox").css("display", "block"); //I don’t know what this is for. If it’s no longer useful, delete it.

//$(".lightBox_wrap").css("display", "block"); //Remove this sentence

$('#' n).css({

"display":"block"; //Add a sentence

here

"width":$('.lightBox').width(),

"height":$('.lightBox').height(),

"top": $(document).scrollTop() $(window).height()/2-$('.lightBox_wrap').height()/2,

"left":($(window).width()-$('.lightBox').width())/2

});

}

jquery pops up a layer! Can you pass a parameter to this layer?

function ShowDiv(show_div,bg_div){

document.getElementById(show_div).style.display='block';

document.getElementById(bg_div).style.display='block' ;

var bgdiv = document.getElementById(bg_div);

bgdiv.style.width = document.body.scrollWidth;

// bgdiv.style.height = $(document).height();

$("#"" bg_div).height($(document).height());

$("#" bg_div).append("canshu");

}; One is to give a parameter to the function function ShowDiv(show_div,bg_div,"canshu"){}

One is to use js to get the value at a specific location. For example, just get the alt attribute in

Put $("#MyDiv").append("Add your parameters"); in your function

How to use js to pop up a layer by clicking a button

Add a click event to the button, fill in a layer, and the width and height are 100%;

This is achieved, click the button to pop up a layer.

The above is the detailed content of How to call assigned function in javascript. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Excel办公网. If there is any infringement, please contact admin@php.cn delete
Top Printers and Scanners and Copiers - MiniToolTop Printers and Scanners and Copiers - MiniToolMay 12, 2025 am 12:52 AM

If you want to buy a top printer & scanner, this post lists some best printers and scanners and copiers including some top HP printers and scanners. php.cn Software not only provides useful computer software but also provides various computer tut

How to Run Windows 11 Network Adapter Troubleshooter - MiniToolHow to Run Windows 11 Network Adapter Troubleshooter - MiniToolMay 12, 2025 am 12:51 AM

You can use the built-in Network Adapter troubleshooter in Windows 11 to find and fix problems with wireless and other network adapters. This post teaches you how to find and run Windows 11 network adapter troubleshooter with detailed instructions. S

[Solved] Battlefield 2042 Black Screen Issues (7 Solutions) - MiniTool[Solved] Battlefield 2042 Black Screen Issues (7 Solutions) - MiniToolMay 12, 2025 am 12:50 AM

Battlefield 2042 black screen then crash is an annoying problem when gaming. How to fix it? This guide on php.cn Website aims at tackling this issue. Look it through carefully and we sincerely hope that our solutions will work fine for you.

How to Fix the Dev Error 11557? Here Are 10 Methods! - MiniToolHow to Fix the Dev Error 11557? Here Are 10 Methods! - MiniToolMay 12, 2025 am 12:49 AM

Have you ever encountered Dev Error 11557 in Call of Duty: Modern Warfare 2 or Warzone 2? If you are, you come to the right place. In this post, php.cn provides some potential solutions to help you fix this error.

How to Cancel Apple Music Subscription on Android/iOS Devices? - MiniToolHow to Cancel Apple Music Subscription on Android/iOS Devices? - MiniToolMay 12, 2025 am 12:48 AM

If you want to cancel your Apple Music subscription, there are several ways to do so. This post from php.cn tells you how to cancel your subscription using your iPhone, iPad, Android device, Mac, or the Apple TV.

Compare All Microsoft 365 Plans and Choose a Preferred Plan - MiniToolCompare All Microsoft 365 Plans and Choose a Preferred Plan - MiniToolMay 12, 2025 am 12:47 AM

Microsoft 365 offers several subscription plans for you to choose from. This post introduces and compares all Microsoft 365 plans. You can choose a preferred Microsoft 365 plan based on your own needs. To recover deleted or lost files like Office fil

VLC Black Screen? A Guide to Fixing 'VLC Not Playing Videos” - MiniToolVLC Black Screen? A Guide to Fixing 'VLC Not Playing Videos” - MiniToolMay 12, 2025 am 12:46 AM

The VLC media player is a free and open-source, portable, cross-platform media player software and streaming media server, which is available for desktop operating systems and mobile platforms. But some people find the “VLC not playing videos” issue

Microsoft To Do Download for Windows 10/11, Mac, Android, iOS - MiniToolMicrosoft To Do Download for Windows 10/11, Mac, Android, iOS - MiniToolMay 12, 2025 am 12:45 AM

To manage your daily tasks, you can use the free task management app - Microsoft To Do. This post teaches you how to download Microsoft To Do on Windows 10/11, Mac, iPhone/iPad, or Android. If you are looking for more computer tips and solutions, you

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment