optikalefx Posted December 15, 2007 Share Posted December 15, 2007 so i found this site http://www.walterzorn.com/dragdrop/dragdrop_e.htm#flexlyr and i wanted to see if theres a way to make it so i can save the source of the page and keep the placement of the pictures. I know i have to edit the code, and ive been studying it for a while, i really want to be able to save it. I think i have to define the position of each image, and then once you lift up from a drag, detect the change, and add that many pixels to the original position? i think.. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 15, 2007 Share Posted December 15, 2007 just download the "wz_dragdrop.zip" file and follow the instructions it is giving on how to set the script up. Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 15, 2007 Author Share Posted December 15, 2007 lol thanks for the response. I know how to get it, and use it. I want to modify it. If you drag a picture, i want it to actually change the HTML of that image in the document. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 15, 2007 Share Posted December 15, 2007 so you just want to change the src of the image when someone drags it from it's original position? Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 15, 2007 Author Share Posted December 15, 2007 Yea so i can save it offline, but the actual HTML the position:absolute;top:#px;left#px; is changed in the code. I think you would have to do it on the mouseUp action after you drag, and determine the changes that occured, I.E the new size, and new position. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 15, 2007 Share Posted December 15, 2007 what do you mean - so you can save it offline - you want to drag the picture from the page to save it to a image file in a folder on your computer? Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 15, 2007 Author Share Posted December 15, 2007 not quite. See on that page how you can freely drag pictures around? And if you hold shift and drag the image resizes. I want that, but i want the changes you make to the picture to be seen in the HTML document, so that i can save the webpage as and see the changes. Basically the question is how do i change the HTML to reflect the changes made to these pictures. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 15, 2007 Share Posted December 15, 2007 server side language - maybe Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 15, 2007 Author Share Posted December 15, 2007 javascript cant modify html? even temporarily? Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 15, 2007 Share Posted December 15, 2007 no - not the source code - the only way to do this is server side. Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 15, 2007 Author Share Posted December 15, 2007 ok so i did some research. and i downloaded a firefox extension, that can edit the text on screen. Temporarily of course. But at that point, you can save the source and the code is actually changed to what you typed. and ff extensions are only javascript and xul. so... now what lol. it actually changes the code as you type using this function. function modifyEdit() { theHtml = document.getElementById("theHtml"); theElement.innerHTML = theHtml.value; } Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 16, 2007 Share Posted December 16, 2007 and ff extensions are only javascript and xul. so... now what lol. guy - you could of done that by manually editing your source code. javascript cant modify html? even temporarily? but you cannot edit your source code with javascript - innerHTML does not physically change your source code. now what guy? Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 16, 2007 Author Share Posted December 16, 2007 i did some more research, and it seems your right that it doesnt "edit" the innerHTML but it does add new text to the source. it ads a new div at the bottom of the page with new values, so when the page is run, those value are taken into account. So it does work. without a server side language. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 16, 2007 Share Posted December 16, 2007 innerHTML does work without server side - it is purely client side; but it still cannot physically change the source code - I think your missing the point. Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 17, 2007 Author Share Posted December 17, 2007 if i use javascript to change the html or innerHtml. and then i save the page. I can open it up later and the source is changed to the new changes that javascript made. The use of this, is that i can make some sort of interface thing with javascirpt to edit things on the page, and save it. and then i can upload it to the web and see all those changes, not to mention the source code is the changed source, i just tested it, it works. when you make the changes and then right click and go view source, of course the changes wont be there, but if you "reload" the page with the changes then you would see the changes. by "reloading" we are saving and reopening. I dont mean to sound bitchy or anything im just in discovery mode. we can mark this as solved. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 17, 2007 Share Posted December 17, 2007 I guess you are right; I guess it does - but this will not work if the web page is on a server. I have never really tried the save the content of a page I changed the innerHTML on; I have all of my web pages on a server and you cannot modify the source code of a web page on a server without server side language or unless you hard code the source code. Update: It will work in FF, but not IE - so your resolution is not cross browser compatible. Quote Link to comment Share on other sites More sharing options...
optikalefx Posted December 17, 2007 Author Share Posted December 17, 2007 i see. I wonder why... Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 17, 2007 Share Posted December 17, 2007 I think the only reason FireFox does it; is because the FireFox browser was designed with coder features that allow you save non-extent source code as raw code. The FireFox browser was created with web designers/coders in mind. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.