timstokman
Oct 22 2004, 11:14 PM
| | I have this small javascript that is supposed to resize an iframe. It works when I replace the var name with normal numbers but not with a variable input. Could someone help me out pls? Here is the script:
<script type="text/javascript"> var forumheight = window.height - 120; document.write("<iframe src=\"http://tim.trap17.com/forum/\" width=\"99%\" height=\"" + forumheight + "\"></iframe>"); </script>
thx in advance |
Reply
timstokman
Oct 23 2004, 12:30 AM
sr, fixed it. Saw something on the internet that helped.
Reply
LuciferStar
Oct 23 2004, 07:58 AM
Do you mean this: CODE function change(var x) { var forumheight = x; document.write("<iframe src=\"http://tim.trap17.com/forum/\" width=\"99%\" height=\"" + forumheight + "\"></iframe>"); }
Reply
timstokman
Oct 23 2004, 11:46 AM
nonono, nevermind. i meant if you replaced the var in the document.write with a number. Its meant to resize an Iframe to fit in the window. It works now just in firefox, not in IE. IE seems to ignore the width settings. Could anyone help me with this: <script type="text/javascript"> var myHeight = 0; var myWidth = 0; if( typeof( window.innerWidth ) == 'number' ) { myHeight = window.innerHeight; myWidth = window.innerWidth; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { myHeight = document.documentElement.clientHeight; myWidth = document.documentElement.clientWidth; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { myHeight = document.body.clientHeight; myWidth = document.body.clienWidth; } else { myHeight = window.height; myWidth = window.width; } myWidth = myWidth - 4; myHeight = myHeight - 133; document.write("<iframe src=\"http://tim.trap17.com/school\" width=\"" + myWidth + "\" height=\"" + myHeight + "\"></iframe>"); </script>
Reply
logman92
Oct 23 2004, 01:10 PM
Good news !! I was integrating your script in a basic HTML page and I found the anomaly ! Go to the line 15 and correct it like this CODE myWidth = document.body.clientWidth; You only forgot the "t" of "client".  I recommend you to debug your program with command like alert('...') in JavaScript, it helps to localize little bugs in all scripts
Reply
timstokman
Oct 23 2004, 03:40 PM
thx alot. Ill try that
Reply
Similar Topics
Keywords : javascript
- Need Help With Javascript Drag And Drop Script
Having trouble with javascript drag and drop script. (2)
Validating Javascript
at the w3c (2) I have added a javascript behaviour to a small sample script and need to know how to get the
javascript approved at the W3C. Here are the test results:
http://validator.w3.org/check?uri=http%3A%...lidator%2F1.591 The validator doesn't like the
onblur and onfocus events added to the input fileds for the script. Any ideas?....
Video Play Like Youtube
php, javascript source code need like player youtube (4) i need help for source code php or javascript... i want display video with a player like in
youtube... please for help?....
Seeking Help With Javascript
Need help with drag and drop type script (1) What i want to make is a script that has a table, which is a menu for my site, and when you click
the top of the table you can drag it to another place in the page. This is the code: Test
run - Right click menu - ŠJack McCrea 2008 <script type="text/javascript"> function
coordinates(event) { if (event.button==2) { var x=event.x; var y=event.y;
document.getElementById("element").style.left=x; document.getElementById("element").style.top=y;
document.getElementById("element").style.visibility="visible"; var oldx=x; var oldy=y; } }
<script type="....
Browser Compatibility Problem With Firefox - Javascript + Css
Having trouble making a script work right - any suggestions? (3) Hi, Im working on a website, and im trying to make a right-click menu, which opens on right click,
wherever the cursor is, and closes on mouse out. I wrote the code below, and when i ran it in IE it
ran fine, just how i wanted it to work. However in firefox, the menu just opened in the top left. im
presuming this is because it doesnt like my style changing in the javascript. Any ideas, and
suggestions? If i cant make this work, i will just make it so it works slightly differently when
viewev in firefox so that it can just open in one place. All ideas appreciated. ....
Creating A Floating Javascript Docking Menu
(1) I have found two scripts. I found one(shown bellow) here that creates a floating box that will
follow you down the page when you scroll. I found another one here that creates a docking menu
like that of OSX. Now I want to combine these effects to create a docking menu that floats and
follows you everywhere you scroll to on the page. In the above code I change the div class from
floatdiv so that it could use the style in the style.css that came with the docking menu. I then got
stuck trying to make both JavaScript scripts work on the same div. I'm appealing ....
Javascript And Ajax For The Web, Sixth Edition Review
(0) If you have read the QuickStart guide to HTML, XHTML & CSS 6th edition, the concept is the same as
you will learn how to begin to code in JavaScript and in AJAX with the help of mini tutorials and
also being able to download these fully functional scripts from the companion website as well.
This book also includes every single JavaScript function as well in the form of a flowchart in order
for a JavaScript coder to understand how to write effective JavaScript and AJAX code. Can purchase
the book here ....
Making A Picture Viewer Website
Html programming or javascript (3) this is one thing i've struggled with for ages. I want a webpage where there are little
thumbnails and in the middle somewhere is the main picture. The littole thumbnails or snipets of
infor when clicked display the main image corresponding to that clicked thumbnail or link. e.g
pictures of the country side listed in pairs or 3's or 4's in a column and you click each
one an the main view on the screen displays that particular picture. How is this achieved. Can any
one gimme a link to a site with templated for that or javascript for that or html code or past....
Lesser Known Useful Javascript Features
(2) Variables Javascript assigns every variable a type which changes as we assign different
values to the variable. We can get the type of a variable using the ' typeof ' operator.
For eg., CODE var hello = "Welcome to Trap17"; var year = 2008; alert(typeof hello
); alert(typeof year ); The above lines will output the type of the first variable
'hello' as String and the second variable 'year' as Number . The types of
Javascript variables are Boolean, Function, Number, Object and String . A variable with ....
Adjusting Rows/cols Of Frames In Frameset Using Javascript Is Not Working In Firefox 3 Is Not Working
(4) I am not able to adjust frames length/width in a frameset using java script functions I am using
firefox 3. In below code changerows is not working for me. Where as same is working in IE6.
Please help me in resolving this issue. Note: here frameset1 is the name given to the FRAMESET.
CODE function changeRows() { parent.frameset1.rows="30%,70%" }function
restoreRows() { parent.frameset1.rows="50%,50%" } ....
Make A Moderately-secure Password System Using Javascript
using file redirection to hide the password. (4) JavaScript is very handy at making forms, allowing for much more customization and easier ways to
send data. So making Login forms using JavaScript may seem to many to be a very feasable idea.
However, JavaScript is very bad at protecting Passwords, as since the passwords are not encypted and
the whole JavaScript code is in the page, a person could just view the Page Source and find out
everything. Even if you use an external JavaScript, it would still be poor as the file name for the
external JavaScript would still be revealed. But I have an answer! There is a rela....
Java Vs Javascript
(11) I thought they were completely different things. Surely javascript should be seperated from the rest....
Document.write & Noscript Questions (javascript)
(1) I am trying to use javascript to include a stylesheet depending on the user's resolution. The
HTML CODE <head> <meta http-equiv="Content-Type" content="text/html;
<?php echo _ISO; ?>" /> <?php if ($my->id) {
initEditor(); } ?> <?php mosShowHead(); ?>
<noscript><link rel="stylesheet" type="text/css"
href="http://www.highimpactart.org/templates/_HighImpactArt_/1024/1024.css"
/></noscript> <script type="....
Do You Close The Javascript?
about browser's secruity (4) hi folks i'm learning that the javascript and cookies sometimes leak your real ip and actions on
surf , some expert advice me close javascript ,stop the function of my opera and IE. so i did.then
everytime i log into a forum i need opend it manually so i can log in. /sad.gif"
style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> and lots of website's using
javascript as a necessary then i opened it manually..oh my life got boring. /dry.gif"
style="vertical-align:middle" emoid=" how your guys doing with that? is it really necessary or
not? bt....
Simple Javascript And Password System
How to protect your pages with password (9) The quickest way to get a password protection system up and running is to use a Prompt box in
JavaScript that has a title like "Enter your Email Address". Only you and the relevant users know
what the password should be, could even be one each, that can be sorted out at the next page then
pass the "input" directly through the url by changing the .href, like
http://www.iSource.net.nz/users/?leTmeIn= The page that then processes this should also check for
the referring page, and three fails from an IP if you like the php (the next page): CODE
<?php // processdo....
Flash And Javascript Interaction
swfobject js questions (1) I don't know if anyone on here is familiar with this script. You can check it out here .
Basically it's a script that is supposed to give you javascript control over a flash object. I
am using it for a flv player. My question is this. I would like to display the current file's
title in a span element on the page, but the function described to gather the information for the
current file doesn't seem to work for me. The function, as outlined on on this page looks
like this: CODE function getUpdate(typ,pr1,pr2,swf) { if(typ == ....
Capturing Username Of Computer
using javascript, is it possible? (3) I wondering if it is possible to try and make a java script to get the computer username and log it?
/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /> edit Topic
title ....
Can I Make Dynamic Menu In Php
is it posible to make dynamic menu in php without javascript (7) As there are many java script by which we can have event based interaction like,message on mouse
over etc,that we can create dynamic menu in javascripts to make navigation bar ,but is it possible
in php to have this acomplished without javascripts,i am new to php,is it possible?. Thanks....
Learn Html Quick And Easy
HTML, javascript, and CSS (14) well eversince i got interested in web desighn i've looked for tutorials but they where not that
helpfull and uderstanderble but there where two web sites that i liked 1. my favorite one was
htmldog it had tutorials on HTML, CSS, and a little bit of javascript. they where very
comprehenseve . and i read through all of them, understoode them, in about less than a week. also
has full references for HTML, and CSS tags. 2.since html dog did not provide realy good javascript
tutorial i looked to w3school for that while it wasnt very understandable too me, maybe it....
Web Page Tree Menu: Style Sheet - Javascript
(6) I got bored and lazy working on the things that I should do... so I end up creating this tree menu
for anyone to use if they find it interesting. Well the idea is to create a tree menu in a webage.
Instead of those linear menu it would be better to add more dynamic to your webpage with a tree
menu. Others use image rollovers. As expecte the tree menu should behave like the one in Windows
Explorer. When you click a node depending on its state it will pull down or pull up its chlid nodes.
I have achieved by exploiting one style sheet property, display . Basically this s....
Simple Scripts In Html And Javascript
Things like BackgroundColorChanger and so (7) like in the topic, here is a description how to change the Backgroundcolor "On The Fly", by klicking
on a button or radio-box first, we ned the html-and body-tags, create a new html-file on your
desktop and write the following: QUOTE <script language = "JAVASCRIPT">
browser interpretation: html - tag means "hey, browser, here comes HTML" in the body-tag you define
the looking of your site. you can add things like "bgcolor" for the background, "text" for the
textcolor and link / alink / hlink / vlink to define the linkcolor ( ) the scripttag i....
Playing Flash Movies Without The One-click Activation: Simple Insertion Of Javascript
(4) In the past year or two iternet explorer and other browsers have updated their coding platforms.
The bad thing is that if you have any flash objects at all within your web page you have to hit the
space bar or click on the flash object to activate it. Once you activate it, you then can interact
with the object or the object will then play on the website. I dont like how you have to activate
the flash player first to interact with it. here is the code to prevent that. Believe me people
notice how much better the site is after you do this. put <script type="text/java....
Hiding <div> Boxes With Javascript
Javascript Help #1 (8) This is my first help post in this Java/JavaScript section. Can someone write/find me a piece of
code that will hide boxes? Preferred stuff: There is a bar that has the subtitle of the box
contents. A button on the right side of the bar shows and hides the div box. Contents are in a box
with a border and slides in and out of the bar smoothly and relatively quickly. Box MUST be
customizable using CSS internal/external stylesheets . Any help would be appreciated. All codes
will be tested and best code be selected.....
Javascript : No Right Click Script !@
This script will allow you to protect your source coad ! (12) This script will help you to protect your source code Add this to Section of your site
! HTML <script language=JavaScript> var message="Function Disabled!";
/////////////////////////////////// function clickIE4(){ if
(event.button==2){ alert(message); return false; } } function
clickNS4(e){ if
(document.layers||document.getElementById&&!document.all){ if
(e.which==2||e.which==3){ alert(message); return false; } } }
if (docume....
Adding Rows & Columns In Html Table Using Javascript
(1) I'm trying to create a website with a form that collects some user information to store in MySQL
database. However, I've a problem when I want to dynamically add new rows and columns in the
HTML table so that the user can add more information in the dynamically added textboxes. Here's
what I have: CODE <table border="0" width="90%"
align="center" id="itemsTable"> <tr>
<td width="20%"> Quantity
<....
One Click Copy And Paste To Clipboard
in simple Javascript (5) I've been search the web for few weeks to see if Java can do one click copy and paste function
to the clipboard and then I can just Ctrl-V the copied "texts." I initially got this idea when I
began to approve hosting application. Instead of writing the same message over and over again, I
decided to make me a page where I can simply copy the code to appropriate answers. And seems like my
laziness is the mother of inventions /laugh.gif' border='0' style='vertical-align:middle'
alt='laugh.gif' /> Instead of doing Ctrl-A, Ctrl-C then Ctrl-V to the post board I started....
Javascript Close Window
Javascript close window (15) Hi does anyone have a code to close the browser window. This code needs to be used to close an
actual full sized window, not a pop-up window.....
Css And Javascript Combined For Dynamic Layout
use of different CSS files at same site (9) This tutorial is meant for people that are dealing with problems while coding their site at 100% of
width. Important notice: Some people has JavaScript disabled, so they will not be able to load CSS
file (take this in account when creating your website). How this script works. In the HEAD of your
HTML document will apply this command, so variable.js file will be load at start: CODE
<script type="text/javascript" src="variable.js"></script> In
browser JavaScript file variable.js is loaded. This Javascript file consist of this para....
Image Preloader With Progress Bar Status
Pure Client-Side JavaScript tested in 4 Browsers! (23) Tutorial: Image Preloader with Progress Bar, by Rob J. Secord, B.Sc. (SystemWisdom)
Description : A Tutorial for a Client-Side Image Preloader with Dynamic Real-Time Progress Bar
Indicator written in JavaScript! Tested to work with 4 Major Internet Browsers: Firefox, MSIE,
Netscape, Opera (Complete sample solution provided at end of tutorial, just put it on your
web-server, add your images and go!) Intended Audience : Beginner to Intermediate Web
Developers. Although this tutorial will cover some advanced aspects of JavaScript, I will try to
explain....
Javascript Slideshow Tutorial
How to make a slideshow in JavaScript (4) JavaScript Slideshow Tutorial I'm going to show you how to make a impressive JavaScript
slideshow. First, you're probably asking: why would I want to make a slideshow in JavaScript?
There are a number of reasons. First, you don't have to build a new HTML page for each picture.
Secondly, the page will load much faster because the of the compactness of the page. Ok let's
get started with this example. First we'll add a <script> tag in the of our HTML
document. In that script tag we will build the following: CODE first = 1; la....
Looking for javascript
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for javascript
*MORE FROM TRAP17.COM*
|
advertisement
|
|