Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Flash] vmode i Google Chrome
Largo
post
Post #1





Grupa: Zarejestrowani
Postów: 203
Pomógł: 6
Dołączył: 11.09.2005

Ostrzeżenie: (0%)
-----


Witam,

Próbuje wczytać banner reklamowy i w FF jak i innych przeglądarkach da się go przesunąć i usunąć. W Chrome robi się to, że da się go przesunać, ale nie ma szans na jego usunięcie lub inne akcje. Przeptrzyłem Google ze sposobami dodawania do param vmode i w embed, niestety nie działają. Czy to znany błąd Chrome czy może czegoś innego?

Jeżeli będzie potrzebny kod go umieszczę, ale nie sądzę, żeby pomógł.

Pozdrawiam,
Largo
Go to the top of the page
+Quote Post
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Jak podasz link na którym jest demonstracja skryptu to wszystko będzie jasne.
Go to the top of the page
+Quote Post
Largo
post
Post #3





Grupa: Zarejestrowani
Postów: 203
Pomógł: 6
Dołączył: 11.09.2005

Ostrzeżenie: (0%)
-----


Cytat(wookieb @ 8.06.2010, 13:35:14 ) *
Jak podasz link na którym jest demonstracja skryptu to wszystko będzie jasne.


[JAVASCRIPT] pobierz, plaintext
  1. var x=0,y=0;
  2.  
  3. function __addFlash(src, width, height, wmode, bgcolor){
  4.  
  5. if (!bgcolor) bgcolor='';
  6. var _f='';
  7. _f = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ';
  8. _f += 'WIDTH='+width+' HEIGHT='+height+'>';
  9. _f += '<PARAM NAME=movie VALUE="'+src+'"><PARAM NAME=quality VALUE=high>';
  10. _f += '<param name="AllowScriptAccess" value="always">';
  11. _f += '<param name="wmode" value="transparent">';
  12. _f +='<PARAM NAME="scale" VALUE="noscale">';
  13. _f += '<EMBED scale="noscale" AllowScriptAccess="always" src="'+src+'" WIDTH='+width+' HEIGHT='+height+' quality=high ';
  14. if (wmode && !window.chrome) _f += 'wmode='+wmode+' ';
  15. if (bgcolor) _f += 'bgcolor='+bgcolor+' ' ;
  16. _f += 'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>';
  17. _f += '</OBJECT>';
  18. return _f;
  19. }
  20.  
  21. function __addLayer(width, height, left, top, visibility,position, zIndex, name,text,background){
  22. if(!name) name='_mainWindow';
  23. if (zIndex==null) zIndex=101;
  24. if (!visibility) visibility='visible';
  25. var _l='';
  26. _l = '<div ';
  27. _l += 'id="'+name+'" name="'+name+'" style="';
  28. _l += 'position: '+position+'; ';
  29. _l += 'background: '+background+'; ';
  30. _l += 'width: '+width+'px; height: '+height+'px; ';
  31. if (top!=null) _l += 'top: '+top+'px; '
  32. if (left!=null) _l += 'left: '+left+'px; ';
  33. _l += 'z-index: '+zIndex+'; ';
  34. _l += '">';
  35. if(text!=null)_l +=text;
  36. _l += '</div>';
  37. return _l;
  38. }
  39.  
  40. function __closeBanerWindow(windowId){
  41. var element=document.getElementById(windowId);
  42. if(element==null)alert('Nie ma.');
  43. var c=element.childNodes.length;
  44. for( i=0;i<c;i++ ){
  45. element.childNodes[i].style.visibility='hidden';
  46. }
  47. element.style.visibility='hidden';
  48. }
  49.  
  50. function __startDrag(elem,ev) {
  51. var mover,upper,dx=0,dy=0;
  52. if (x!= -1) dx = ev.clientX - x;
  53. if (y != -1) dy = ev.clientY - y;
  54. document.addEventListener('mousemove',mover=function(ev) {
  55. x= Math.max(0,ev.clientX - dx);
  56. y = Math.max(0,ev.clientY - dy);
  57. elem.style.left = x+ 'px';
  58. elem.style.top = y + 'px';
  59. ev.stopPropagation();
  60. ev.preventDefault();
  61. },true);
  62. document.addEventListener('mouseup',upper=function(ev) {
  63. document.removeEventListener("mousemove",mover,true);
  64. document.removeEventListener("mouseup",upper,true);
  65. ev.stopPropagation();
  66. ev.preventDefault();
  67. },false);
  68. ev.stopPropagation();
  69. ev.preventDefault();
  70. }
  71.  
  72. function __ieStartDrag(target,ev) {
  73. var mover,upper,dx=0,dy=0;
  74. if( x!= -1 ) dx = ev.clientX - x;
  75. if( y != -1 ) dy = ev.clientY - y;
  76.  
  77. document.attachEvent('onmousemove',mover=function(ev) {
  78. x= Math.max(0,ev.clientX - dx);
  79. y = Math.max(0,ev.clientY - dy);
  80. target.style.left = x+ 'px';
  81. target.style.top = y + 'px';
  82. });
  83. document.attachEvent('onmouseup',upper=function(ev) {
  84. document.detachEvent("onmousemove",mover);
  85. document.detachEvent("onmouseup",upper);
  86. });
  87. }
  88.  
  89. function __createEventListener(target, event) {
  90. if ( typeof target.addEventListener != "undefined" ){
  91. target.addEventListener(event,function(ev){ __startDrag(target,ev)},false );
  92. }else if ( typeof target.attachEvent != "undefined" ){
  93. event ='on'+event;
  94. target.attachEvent(event,function(ev){__ieStartDrag(target,ev)});
  95. }
  96. }
  97.  
  98. function __resizeBanerWindow(windowId,width,height){
  99.  
  100. var element=document.getElementById(windowId);
  101. if(element==null)return 0;
  102. var c=element.childNodes.length;
  103. for( i=0;i<c;i++ ){
  104. element.childNodes[i].style.clip='rect(0,'+element.style.width+','+(height)+',0)';
  105. }
  106. element.style.clip='rect(0,'+element.style.width+','+(height)+',0)';
  107. }
  108.  
  109. function __BanerWindow(fwidth,fheight,fSrc,dName){
  110. var left = (screen.width/2)-(fwidth/2);
  111. var top=(screen.height/2)-(fheight);
  112. if( left<50 )left=100;
  113. if( top>40 )top=50;
  114. x=left; y=top;
  115. var _mf = __addFlash(fSrc,fwidth,fheight,'transparent');
  116. var _m2 = __addLayer(fwidth, fheight, left, top, 'visible','absolute',96, dName,_mf,'transparent');
  117. document.write(_m2);
  118. var element=document.getElementById(dName);
  119. if( element == null )return 0;
  120. __createEventListener(element, "mousedown");
  121. }
[JAVASCRIPT] pobierz, plaintext


Strony nie mogę podać, bo ma zabezpieczenie na zakres IP.

Nie działa podobno na Google Chrome i Apple Safari. Nie mam pojęcia dlaczego, czy ktoś mi pomoże?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.09.2025 - 16:15