Connecting Tech Pros Worldwide Forums | Help | Site Map

Dynamically changing DIV tag's CSS propertie

Newbie
 
Join Date: Aug 2008
Posts: 17
#1: Dec 17 '08
Hi,
I am having a div tag that has a SWF video player inside it. I dynamically change its position on click of a button to pop out as a absolutely positioned DIV in the center of the browser page with a high Z-Index. It works very well. But this activity refreshes that div, hence the video starts from beginning and not where it was popped out. Any method to retain the video position, not letting it reload innerHTML.

Thanks in Advance.

Expert
 
Join Date: Nov 2006
Posts: 392
#2: Dec 17 '08

re: Dynamically changing DIV tag's CSS propertie


That sounds like an issue with the plug-in/player not your JavaScript, but we can not really say for sure since you did not post the code you are asking about.

You might try an IFrame tag instead of a div.
Newbie
 
Join Date: Aug 2008
Posts: 17
#3: Dec 19 '08

re: Dynamically changing DIV tag's CSS propertie


Hi Pronerd,
Thanks for reply,
I am pasting the code below
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('videoTd').className='popped';
  2.  
  3. document.getElementById('mapexpand').innerHTML='Collapse';
  4.  
  5. var elementVar=document.getElementById('videoTd');
  6.  
  7. Drag.init(elementVar);
  8.  
  9. elementVar.style.position='absolute';
  10.  
  11. elementVar.style.left=(document.body.offsetWidth/2)-240+"px";
  12.  
  13. elementVar.style.top=(document.body.offsetHeight/2)-175+"px";
  14.  
  15. elementVar.style.zIndex=40000;
  16.  
  17. document.getElementById("synctable").className="syncxpand";
  18.  
  19. document.getElementById('mapTd').height=document.body.offsetHeight-270+"px";
  20.  
  21. document.getElementById('map').style.height=document.body.offsetHeight-270+"px";
  22.  
  23. document.getElementById('mapleft').style.display="none";
  24.  
  25. document.getElementById('mapright').style.display="none";
  26.  
  27. document.getElementById('videoTd').borderLeft="";
  28.  
  29. zoomToFitRoute();
  30.  
  31. document.getElementById('minvideo').style.display="block"; 
  32.  
  33. document.getElementById('maxvideo').style.display="none"; 
  34.  
  35. document.getElementById('minvideo').onclick=clearVideoTd; 
  36.  
  37.  
The videoo player is inside a div tag which is inside a td of a table. I move it out to the center of the browser as a popup div having a hight zIndex.
Reply

Tags
absolute, css, innerhtml, javascript, videoplayer