Using document.getElementById to change an element size works in iWeb but not when site published

I am trying to use an HTML snippet to construct a "popup" to show explanatory text on iWeb windows. This is the code:
<div id="divName"></div>
<style type="text/css">
/*<![CDATA[*/
#divName {
     border:solid 0px #000;
     text-align:left;
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
function mouseOver()
    var el=document.getElementById("divName");
                   el.style.width=400+"px";
                   el.style.height= 200+"px";
                   el.style.margin="auto";
                       el.style.backgroundColor="#ffffff";             
          el.innerHTML="this is a bit of text, and this is some more";
function mouseOut()
    var el=document.getElementById("divName");
                   el.style.width=80+"px";
                   el.style.height= 20+"px";
                   el.style.margin="auto";
          el.innerHTML=" ";
                       el.style.backgroundColor="";             
window.onload=mouseOut;
window.onmouseover=mouseOver;
window.onmouseout=mouseOut;
//]]>
</script>
This works o.k. when tested inside iWeb. When the mouse is rolled over the element it is enlarged, the background colour changed and the text displayed. However, when I publish the site the background colour changes and the text is displayed BUT the size of the element remains set to the size set in the "mouseOut" function. On one occasion after publishing it did actually work, but mostly it doesn't!
What am I doing wrong?
Incidentally, when testing under iWeb, the mouseOut function sometimes doesn't shrink the element back to its original size. Mostly it does, but when it doesn't the background has still been made transparent and the text removed. It only appears to be the height and width functions that are failing!

Here's how I started :
http://www.wyodor.net/Ajax/Ajax.html
But to avoid having to edit the page after editing the iWeb page, i figured out a way to do it with a JavaScript :
http://www.wyodor.net/mfi/Maaskant/How_To.html
The magic word is : unique word. Then replace it with your own code.
Then I advanced it a bit to this :
http://www.wyodor.net/_Demo/Fancy/Dynamic_Text.html
And here's an explanation what the HTML Snippet does :
http://www.wyodor.net/blog/archives/2009/07/entry_213.html
You may have to learn HTML/CSS/JavaScript/DOM/AJAX and how iWeb creates its pages.

Similar Messages

  • HT3387 When I use pages the languages that I mainly use are English and Hebrew. The spellchecker works for English but not with Hebrew. How can I add another language to the spellcheck?

    When I use pages the languages that I mainly use are English and Hebrew. The spellchecker works for English but not with Hebrew. How can I add another language to the spellcheck?

    http://m10lmac.blogspot.com/2011/06/extra-spell-checking-dictionaries-for.html

  • My facebook password was hacked on my pc. I changed it and it works on pc ,but not IPhone.Help

    My facebook password was hacked .I have a pc and changed my facebook password and it works on my pc but not my iphone.I plugged the iphone into computer thinking it would sync. That didn't fix my phone.What to do? can't sign in on ipone as it says"password incorrect."

    You'll have to take your machine to an Apple Store or an AASP. They will (or should) be able to help.
    Good luck,
    Clinton

  • Firefox crashes when saving a file using the "Alsways ask me where..." download option, but NOT when using the default "Save files to..." download option.

    My OS is XP-x64.
    The Firefox version I am on is 14.0.1 (July 2012, "FunnelCake").
    The "C: \Documents and Setting\Downloads\" is the folder I used to try downloading the same file to via 2 different methods.
    1) When this folder is set as the permanent download location, it works.
    2) When I use the "Always ask me where.." download setting, and I select the same folder, the Firefox window completely disappears without any message at all !
    I get the same result with (2) even if I already turned my VirusScan software off.
    This same behavior persists after completely uninstalling and re-installing Firefox.

    Hi,
    You can try to right-click and '''Reset''' the '''browser.download.lastDir''' key in [http://kb.mozillazine.org/About:config about:config].
    [http://kb.mozillazine.org/About:config_entries about:config Entries]

  • JNI Works for application, but not when used over Tomcat...

    I am having problems getting JNI to work when I try to run a Servlet that invokes native calls.
    I have a small, simple java program, just to test the waters, that simple calls a small shared library. It works like magic when I run the program as a simple application.
    However, when I turn it into a Servlet, I get the following runtime errors:
    The first time I call the Servlet:
    java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.native)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
         at java.security.AccessController.checkPermission(AccessController.java:399)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
         at java.lang.SecurityManager.checkLink(SecurityManager.java:837)
         at java.lang.Runtime.loadLibrary0(Runtime.java:743)
         at java.lang.System.loadLibrary(System.java:820)
         at Native.(NativeApp.java:24)
         at NativeApp.service(NativeApp.java:15)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
         at org.apache.tomcat.core.Handler.service(Handler.java:286)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
         at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
         at java.lang.Thread.run(Thread.java:484)
    On hitting reload (F5), I get this:
    java.lang.NoClassDefFoundError
         at NativeApp.service(NativeApp.java:15)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
         at org.apache.tomcat.core.Handler.service(Handler.java:286)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
         at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
         at java.lang.Thread.run(Thread.java:484)
    Before going and farther, here is the server specs:
    Linux (cobalt, basically red hat)
    java 1.3
    recent version of tomcat
    Now, just to be sure, I removed the native call from the servlet, and ran it again...no problem this time. So I know that it has to be the native call that is causing this.
    I have to say that I am still a bit new to JNI (book is in the mail form amazon still, hehe)...any ideas would really be appreciated.
    I have a feeling that this may have little or nothing to do with JNI...but it seems to be related in some way.
    -Zach

    Well, I have came to the same conclusion, that the problem that I am having is directly related to the security policy that Tomcat runs under.
    However, I have not been able to figure out exactly what I need to change....
    I have altered the tomcat.policy file in a number of ways, including (for testing purposes) allowing full permission on the site that has the JNI servlet on it.
    I have also done the same for the folder containing the shared library, I don't know if mattered, but I tried to be sure.
    At this point, I have ordered a number of books from Amazon that should (hopefully) have some answers, but it is still a bit confusing that after allowing all permissions (and rebooting) that it still failed to work.
    Dose anyone know how that you would allow native methods to be called in a policy file?
    Thanks again for any suggestions!
    -Zach

  • How to use "document.getElementById()" using MVC and  bsp:call

    I follow the tutorial from saptechnical .com about F4 in BSP and it works.
    But my problem, is that is not working in my BSP I get javascript error "document.getElementById() is null" the popup appear I select the value but when I press the button to close the popup and pass the value nothing appears.
    I think that is because im Using MVC and Views that call a controller (like view inside views).
    I have in my main.htm this:
    <htmlb:form id     = "search"
                   method = "get" >
            <bsp:call url     = "search.do"
                      comp_id = "search" >
            </bsp:call>
    </htmlb:form>
    The code with the help values is in the search.htm(this the page associated with controller search.do)
    So Im thinking that my problem is because the form isnt in the SAME page than my inputField  and that is why im getting that error.  Can be this true ?
    And if it is,  how can I solve it?, I have several pieces of page with controllers and If I try to put the form tag in each "piece" I get an error that a button was left without a parent form tag, and I there isnt any button tag without form tag. So I think that another element tray, tabstrip or something require form tag also.
    I hope that I could explain my problem and someone can give me a hand.
    Can It be that this js statement
    document.getElementById("i_VKORG_low").value = fval;
    only works only if the form tag is in the same htm page, and cause I have teh form tag declared in the main.htm and the fieldtext i_VKORH_low in search.htm it doesnt works ?
    Thx
    EDIT: I cant post my javascript source code...dont know why I get an error from the forum that the post is not supported

    Hello,
    If I remember well, the MVC framework adds the comp_id of the bsp_call to all elements in the subcontroller.
    Try using:
    document.getElementById("search_i_VKORG_low");
    Regards,
    Tanguy

  • My ipod has had a previous owner How do I change my ipods email address so that when I try to down load anything it asks for the previous owners password but when I go to my account it says its my email my account but not when I try to download????

    My ipod has had a previous owner How do I change my ipods email address so that when I try to down load anything it asks for the previous owners password but when I go to my account it says its my email my account but not when I try to download can anyone please help me ????Plus it still has some of the previous owners pictures and videos on it that I want to delete and can't????? Also is there a way to kill the apps that u have used throughout the day the battery doesn't last long at all ??????

    - How did you dlete stuff from the iPod? If you have a 1G or 2G iPod and deleted the stuff by going to Settings>Genera.>Reset>Erase aall contents and settings without being connected to a power source, the battery dies before he erase was comleted since it can take hour.
    - In any event try the following:
    - Connect to a chaging sour for three hours.
    - Reset the iPod and then connect to the computer and try to restore va iTunes.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Next try placing the iPod in recovery moe and then try to restore. For recovery mode:
    iPhone and iPod touch: Unable to update or restore
    - Last try DFU made and restore.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings

  • I bought my iPhone 4s in the Uk and then brought to Cyprus where I live. I used Siri to call my husband 2 days ago without problem but now when I try to use Siri it won't call any local Cypriot number but will call my Uk contacts. Help please

    I bought my iPhone 4s in the Uk and then brought to Cyprus where I live. I used Siri to call my husband 2 days ago without problem but now when I try to use Siri it won't call any local Cypriot number but will call my Uk contacts. I can call the same numbers manually so it's not my network. Any help would be appreciated.

    This sounds like an international issue? Although I can not see why? I brought my phone in Australia and operating it in Indonesia, I have the same issues.... Otherwise Siri works fine, even texting (SMS) to local numbers siri works well, but dialing local number it just wont work...! I will try using my Australian SIM card and see if that is the reason.. I tried changing the number in the contacts and took out the international prefix, I turned the international assist on and off still nothing.. How frustrating. I called apple, the technican had know idea and we to his supervisor, had to wait fro 40 miuntes and then I hung up..
    PLEASE HELP..!

  • I imported photos from an old iPhoto (2001) to photo library and can now see them as thumbnails but not when I click on them. The screen is black cannot see or print either. Is there any way to salvage those old photos? I now use iLife09. OS 10.6

    I imported photos from an old iPhoto (2001) to photo library and can now see them only as thumbnails but not when I click on them. The screen is black cannot see or print either. Is there any way to salvage those old photos? I now use iLife09. OS 10.6

    Did you import the old iPhoto library into the new one? That's not what you want to do because you will import all of the original, modified and thumbnail files as if they were original files. Lots of duplicates and useless small photos.
    Do you have a backup copy of the library that you imported into to?  If you do then bring it in and then use  iPhoto Library Manager to merge the two libraries into a new, 3rd library.
    If you don't then you'll have to try to fix the current one and then cull out the duplicates and small useless photos as follows:  make a temporary, duplicate copy of your library and apply the three fixes in order as necessary.
    Fix #1
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your HD/User/Home()/ Library/Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your HD/User/Home()/Library /Caches/com.apple.iPhoto folder. 
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    Fix #2
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Select the options identified in the screenshot. 
    Fix #3
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    If this doesn't fix the problem you'll have to start over from scratch and create a new library from the files inside the Originals folder of your current library.  But first you should cull out the small photos that would be the thumbnails from the 2001 library.
    Move the Originals folder to the Desktop, open and do a search for Kind=photo, File size is less than 10 KB.  That should find all of the thumbnail files which you can then drag to the Trash.  You might have to make that less than 50 KB. Then Import the remaining photos into a new iPhoto library.
    OT

  • When I try to log onto Icloud in Windows 7 64-bit using my Apple ID it says my Apple ID is valid but not an Icloud account.  I can't go anywhere with Icloud after that.

    When I try to log onto Icloud in Windows 7 64-bit using my Apple ID it says my Apple ID is valid but not an Icloud account.  I can't go anywhere with Icloud after that.

    Welcome to the Apple community.
    These types of messages often indicate a problem with the devices serial number, have you had your phone repaired at any stage or did you buy it second-hand.

  • I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    Hi mafiose15,
    Thanks for visiting Apple Support Communities.
    Restoring your iPod to factory settings is the best way to try and get it back to working order. You can use the instructions below to restore it:
    How to restore iPod
    Verify that you have an active Internet connection, because you may need to download new versions of the iTunes and iPod Software.
    Download and install the latest version of iTunes if necessary.
    Open iTunes. Connect your iPod to your computer using the USB or FireWire cable that came with your iPod.
    After a few moments, your iPod will appear in the Source panel in iTunes.
    Select your iPod in the Source panel. You will see information about your iPod appear in the Summary tab of the main iTunes window.
    Click Restore.
    If you are using a Mac, you will be asked to enter an administrator’s name and password.
    A progress bar will appear on the computer screen, indicating that stage one of the restore process has begun. When this stage is done, iTunes will present one of two messages with instructions specific to the iPod model you are restoring.
    Disconnect iPod and connect it to iPod Power Adapter (typically applies to older iPod models).
    Leave iPod connected to computer to complete restore (typically applies newer iPod models).
    During stage two of the restore process, the iPod displays an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remain connected to the computer or iPod power adapter during this stage.
    Note: The progress bar may be difficult to see, because the backlight on the iPod display may be off.
    After stage two of the restore process is complete, the iTunes Setup Assistant window will appear. It will ask you to name your iPod and choose your syncing preferences, as it did when you connected your iPod for the first time.
    You can find the instructions in this article:
    Restoring iPod to factory settings
    http://support.apple.com/kb/ht1339
    All the best,
    Jeremy

  • How to send active links in email from firefox. Works in IE but not Firefox... Is there a setting to change?

    how to send active links in email from firefox. Works in IE but not Firefox... Is there a setting to change?
    == This happened ==
    Every time Firefox opened
    == Always

    Check with your web mail service provider for help with that issue.

  • Can firefox support "file:///" format to access local files (note 3 fw slashes) this works for IE but not firefox and is the format used in the "afghan war diary" from wikileaks

    can firefox support "file:///" format to access local files (note 3 fw slashes) this works for IE but not firefox and is the format used in the "afghan war diary" from wikileaks

    See http://kb.mozillazine.org/Links_to_local_pages_do_not_work

  • HT3775 I am using OS X Mountain Lion and I have this .avi file but not able to read. What is missing in my setup and what other file do I need to download to enable me to read?  I can read mp4 files though.

    I am using OS X Mountain Lion and I have this .avi file but not able to read. What is missing in my setup and what other file do I need to download to enable me to read?  I can read mp4 files though.

    Here is a link: https://itunes.apple.com/en/app/mplayerx/id421131143?mt=12
    I agree that VLC is also a good choice but MPlayerX is more user friendly.

  • My iphone 4 camera shutter won't open. I have already done a restore and I am using the latest iOS. The front facing camera works during FaceTime but crashes when I switch to rear camera. in Camera mode I can't switch to front camera.

    My iphone 4 camera shutter won't open. I have already done a restore and I am using the latest iOS. The front facing camera works during FaceTime but crashes when I switch to rear camera. in Camera mode I can't switch to front camera. I plan on replacing this phone with an iphone 5s when it comes out but I need this phone to work until then.

    When you did the restore, did you restore from a backup or restore as new? The final step of user troubleshooting is to restore as a new device, not from a backup. If you restore as a new device and the camera still does not function, it is probably a hardware issue. Make an appointment at the Apple Store Genius Bar and have the device checked by a Genius.

Maybe you are looking for