FSTUTS FORUMERS
Dont forget to join!

Please Read the forum rules and regulations before posting^_^

Thank You!

Join the forum, it's quick and easy

FSTUTS FORUMERS
Dont forget to join!

Please Read the forum rules and regulations before posting^_^

Thank You!
FSTUTS FORUMERS
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Draggable Primary

3 posters

Go down

Draggable Primary Empty Draggable Primary

Post by Psycho Dancer Fri May 29, 2009 1:58 pm

Code:
try {
    sty = document.createElement("style");
    sty.type = "text/css";
    sty.innerHTML = ".imgblock200{position:relative;}";
    document.getElementsByTagName("head")[0].appendChild(sty);
}catch(e){}
try {
    document.styleSheets[document.styleSheets.length - 1].addRule(".imgblock200", "position:relative;");
}catch(e){}

var ie=document.all;
var nn6=document.getElementById&&!document.all;

var isdrag=false;
var x,y;
var dobj;

function movemouse(e) {
  if (isdrag) {
    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
    return false;
  }
}

function selectmouse(e) {
  var fobj      = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";

  while (fobj.tagName != topelement && fobj.className != "imgblock200") {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }

  if (fobj.className=="imgblock200") {
    isdrag = true;
    dobj = fobj;
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }
}

document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");

var disprimpic = getElementsByClassName(null,"div","imgblock200")[0];
disprimpic.innerHTML = disprimpic.innerHTML.replace(/<a[\S\s]+?>/i,"").replace(/<\/a>/,"");

function getElementsByClassName(oElm,sTag,sClass) {
        var elm = [];
        if (!oElm)oElm = document;
        if (!sTag)sTag = "*";
    var els = oElm.getElementsByTagName(sTag) || document.all;
            for (var j=0,k=els.length;j<k;j++) {
                if (new RegExp(sClass).test(els[j].className)) {
                    elm.push(els[j]);
                }
            }
            return elm;
}

Paste it on your External Js
Psycho Dancer
Psycho Dancer
MOD
MOD

Posts : 166
Reputation : 45
Join date : 2009-05-27
Age : 34
Location : Binangonan Rizal

http://www.friendster.com/psychodancer

Back to top Go down

Draggable Primary Empty Re: Draggable Primary

Post by [DYOSZA]JiNRiKiSHA Fri May 29, 2009 2:06 pm

thnx for sherin it here kua paul
it will help a lot Razz
[DYOSZA]JiNRiKiSHA
[DYOSZA]JiNRiKiSHA
Graphic Artist
Graphic Artist

Posts : 207
Reputation : 15
Join date : 2009-05-26
Age : 32
Location : Mars

http://www.friendster.com/miinidii

Back to top Go down

Draggable Primary Empty Re: Draggable Primary

Post by [DYOSZA]gane Sun Jun 21, 2009 9:00 am

keWL tencHu s share
[DYOSZA]gane
[DYOSZA]gane
MOD
MOD

Posts : 221
Reputation : 122
Join date : 2009-05-26
Age : 27
Location : Baguio City, Philippines

Back to top Go down

Draggable Primary Empty Re: Draggable Primary

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum