JavaScript.4 2012.

Slides:



Advertisements
Similar presentations
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
Advertisements

Web-based Application Development Lecture 13 February 21, 2006 Anita Raja.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Banners - HTML A banner is a zip-package containing a HTML file, CSS file, and optionally JavaScript file and assets in a asset directory. The banner is.
Working with background, images and date object Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Manipulating the DOM CST 200 – JavaScript 3 –
 HTML is hypertext markup language. It is a way for people to display their information with more complex pictures and text displays. Before HTML, messages.
CSCE 102 – Chapter 9 (Functions and Parameters) CSCE General Applications Programming Benito Mendoza Benito Mendoza 1 By Benito Mendoza.
Creating Web Documents: JavaScript Continue with JavaScript Form check Dice (die) throw Questions for midterm Homework: Prepare for midterm. Complete project.
HTML IMAGES. CONTENTS IMG Tag Alt Attribute Setting Width and Height Of An Image Summary Exercise.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
1/25/2016B.Ramamurthy1 Exam3 Review CSE111 B.Ramamurthy.
HTML DOM The Document Object Model is a Javascript class that defines HTML elements as objects. It supports … properties methods events Image from
Revision Webpage design HTML.   FACE  Attributes  Marquee  Define the following terms.
The Web Wizard’s Guide To JavaScript Chapter 4 Image Swapping.
HTML Help book. HTML HTML is the programming language used to make web pages for the Internet. HTML stands for Hyper Text Markup Language. HTML is made.
Web Programming Scripting Frames and Multiple Windows AND Images.
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
HTML basics
Applied Component I Unit II Introduction of java-script
CSE 102 Introduction to Web Design and Programming
Images in HTML PowerPoint How images are used in HTML
In this session, you will learn about:
JavaScript is a programming language designed for Web pages.
Data Virtualization Tutorial… CORS and CIS
JAVASCRIPT.
Intro to HTML Mr. Singh.
In this session, you will learn about:
Intro to JavaScript CS 1150 Spring 2017.
The Document Object Model (DOM) is a W3C standard.
Chapter 14: DHTML: Event Model
In this session, you will learn to:
JavaScript Functions.
Web Design and Development
Simplest Rollover (nonJavaScript!)
<TAG> <html> <head>
JavaScript Client-side
Programming the Web using XHTML and JavaScript
JavaScript for Beginners
CHAPTER 4 CLIENT SIDE SCRIPTING PART 2 OF 3
IS1500: Introduction to Web Development
Document Object Model That’s DOM to you
يمكن استدعاء الكود الوظيفي عند حدث معين أو عند استدعاء الكود الوظيفي .
JQuery UI Plug-ins, Object Models & the Window Object
Javascript: variables and parameters
Event Driven Programming & User Defined Functions
Events Comp 205 Fall 2017.
Basic HTML and Embed Codes
يمكن استدعاء الكود الوظيفي عند حدث معين أو عند استدعاء الكود الوظيفي .
Working with Special Effects
Loading Scripts.
JavaScript What is JavaScript? What can JavaScript do?
JavaScript onLoad arrays
The Web Wizard’s Guide To JavaScript
Pertemuan 1b
JavaScript Basics Three evening classes A, B and C
<html> This tag is used to begin each html document
JavaScript What is JavaScript? What can JavaScript do?
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Common Page Design Elements
Graphics Considerations
JavaScript Overview By Kevin Harville.
USING IMAGES This is the bottom of the page. Note the alignment of having text before and after, at the top, in the middle and at the bottom. Code is on.
JavaScript Basics What is JavaScript?
Programming games Share your plans for your virtual something.
Hover Button Hover button Rename any two pictures in C:/100/pics to
JavaScript for Beginners
JavaScript for Beginners
Images in HTML PowerPoint How images are used in HTML
Presentation transcript:

JavaScript.4 2012

Отношения между фреймами Родительский – дочерний [window.]frames[n].ObjFuncVarName [window.]frameName.ObjFuncVarName Дочерний – родительский parent.ObjFuncVarName top.ObjFuncVarName Дочерний – дочерний parent.frames[n].ObjFuncVarName parent.frameName.ObjFuncVarName

Изображения Объект Image document.images[n] document.images[“imageName”] document.imageName

Предварительное кэширование изображений var myImage = new Image(width, height) myImage.src = “someArt.gif” document.images[0].src = myImage.src

Пример кэширования (1) <HTML><HEAD><TITLE>Image Object</TITLE> <SCRIPT LANGUAGE=”JavaScript1.1”> // pre-cache four images image1 = new Image(120,90) image1.src = “desk1.gif” image2 = new Image(120,90) image2.src = “desk2.gif” image3 = new Image(120,90) image3.src = “desk3.gif” image4 = new Image(120,90) image4.src = “desk4.gif” // load an image chosen from select list function loadCached(list) { var img = list.options[list.selectedIndex].value document.thumbnail.src = eval(img + “.src”) } </SCRIPT></HEAD>

Пример кэширования (2) <BODY > <H2>Image Object</H2> <IMG SRC=”desk1.gif” NAME=”thumbnail” HEIGHT=90 WIDTH=120> <FORM> <SELECT NAME=”cached” onChange=”loadCached(this)”> <OPTION VALUE=”image1”>Bands <OPTION VALUE=”image2”>Clips <OPTION VALUE=”image3”>Lamp <OPTION VALUE=”image4”>Erasers </SELECT> </FORM> </BODY> </HTML>

Ролловер (1) <HTML> <HEAD> <TITLE>Jukebox/Image Rollovers</TITLE> <SCRIPT LANGUAGE=”JavaScript”> if (document.images) { // precache all ‘off’ button images var offImgArray = new Array() offImgArray[“play”] = new Image(75,33) offImgArray[“stop”] = new Image(75,33) offImgArray[“pause”] = new Image(75,33) offImgArray[“rewind”] = new Image(86,33) // off image array -- set ‘off’ image path for each button

Ролловер (2) offImgArray[“stop”].src = “images/stopoff.jpg” offImgArray[“pause”].src = “images/pauseoff.jpg” offImgArray[“rewind”].src = “images/rewindoff.jpg” // precache all ‘on’ button images var onImgArray = new Array() onImgArray[“play”] = new Image(75,33) onImgArray[“stop”] = new Image(75,33) onImgArray[“pause”] = new Image(75,33) onImgArray[“rewind”] = new Image(86,33) // on image array -- set ‘on’ image path for each button onImgArray[“play”].src = “images/playon.jpg” onImgArray[“stop”].src = “images/stopon.jpg” onImgArray[“pause”].src = “images/pauseon.jpg” onImgArray[“rewind”].src = “images/rewindon.jpg” }

Ролловер (3) // functions that swap images & status bar function imageOn(imgName) { if (document.images) { document.images[imgName].src = onImgArray[imgName].src } function imageOff(imgName) { document.images[imgName].src = offImgArray[imgName].src function setMsg(msg) { window.status = msg return true

Ролловер (4) // controller functions (disabled) function playIt() { } function stopIt() { function pauseIt(){ function rewindIt() { </SCRIPT> </HEAD> <BODY> <CENTER> <FORM> Jukebox Controls<BR>

Ролловер (5) <A HREF=”javascript:playIt()” onMouseOver=”imageOn(‘play’); return setMsg(‘Play the selected tune’)” onMouseOut=”imageOff(‘play’); return setMsg(‘’)”> <IMG SRC=”images/playoff.jpg” NAME=”play” HEIGHT=33 WIDTH=75 BORDER=0></A> <A HREF=”javascript:stopIt()” onMouseOver=”imageOn(‘stop’); return setMsg(‘Stop the playing tune’)” onMouseOut=”imageOff(‘stop’); return setMsg(‘’)”> <IMG SRC=”images/stopoff.jpg” NAME=”stop” HEIGHT=33 WIDTH=75 BORDER=0></A> <A HREF=”javascript:pauseIt()” onMouseOver=”imageOn(‘pause’); return setMsg(‘Pause the playing tune’)” onMouseOut=”imageOff(‘pause’); return setMsg(‘’)”> <IMG SRC=”images/pauseoff.jpg” NAME=”pause” HEIGHT=33 WIDTH=75 BORDER=0></A> <A HREF=”javascript:rewindIt()” onMouseOver=”imageOn(‘rewind’); return setMsg(‘Rewind tune’)” onMouseOut=”imageOff(‘rewind’); return setMsg(‘’)”> <IMG SRC=”images/rewindoff.jpg” NAME=”rewind” HEIGHT=33 WIDTH=86 BORDER=0></A> </FORM></CENTER></BODY></HTML>