Search This Blog

Monday, October 11, 2010

JavaScript - MouseOver Image

< script language="javascript">

function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
function close_window()
{
my_window.close();
}

< /script>

-------------------------------------
< a href="#"> < img src="../Images/sun-flower-white.jpg" onMouseOver="PopupCenter('../Images/sun-flower-white.jpg','test',500,500)" id="image1" width="200" height="150" alt="test" /> </a >

4 comments:

  1. OnMouseOver is not accepted in SharePoint. It automatically deletes the code even if you place it through 'Edit HTML'.

    ReplyDelete
    Replies
    1. Are you using Sharepoint 2010 or 2013? If 2013 use ScriptEditor webpart and put in above script. 2010 use content Editor webpart EmpedCode and put script.

      Delete
  2. onmouseover is not working in sharepoint 2013.

    ReplyDelete
    Replies
    1. am not tested sharepoint 2013. i will test it and update you thanks.

      Delete