Jump to content

emehrkay

Staff Alumni
  • Posts

    1,214
  • Joined

  • Last visited

About emehrkay

Profile Information

  • Gender
    Not Telling

emehrkay's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. you need qoutes around html attributes value="<?php echo $val; ?>"
  2. I need a way to take html created with a wysiwyg editor and a few options (bkg image&color etc) and be able to print it as it was defined with the editor. All css stylings are lost when the user goes to print, so my solution would be to convert that html string into a GD image. I figure this shouldnt be too difficult as long as the style is inline with the html. I figured it would be useful for others so I would try to make it a generic lib. I just need some help identifying which gd functions would be needed to do what as I have never really used it before. Here is the process that I've thought out so far, tell me if I am missing anything and help me out in some areas [*]Define Defaults -- font, font size, font color, font bkg color, and image x y [*]Read and parse html string this step will read each html element removing the style attribute and using the applicable defintions to style the element. ie <span style="background-color: #red;">test</span> would create a red box with test as the text. If the element doesnt have one of the default settings, use the default that was defined before. The result would be an array with all of the elements' types and GD rules. array(array('type'=> 'text', 'value' => 'test' 'font_color' => '#red')) etc. [*]convert the findings on each element to the GD equivalent in this step I would have to make it follow html rules as much as possible, all block level elements are treated as such etc [*]save the image to disk (possible stream in the future) and discard the resource functions/methods that id need [*]imagettfbbox [*]imagefilledrectangle [*]imagecreatetruecolor [*]imagecolorallocate [*]gd one that loads existing images (I cannot identify this) [*]hex to rgb and back [*]add on... Any suggestions? Does this already exist? Am I in over my head? HELP! I'll make it a google code project once I get something going (well, if it proves to be of any use) Thanks
  3. 100% height only works on elements whose parent has a defined height. You are doing nested 100% height definitions. Id try to work around that.
  4. ids are supposed to be unique, it looks like you have 12 divs with the id of viewmore. change that to a class and change $('#viewmore').show(); to $('.viewmore').show(); and it will probably work
  5. http://us2.php.net/manual/en/function.fgetcsv.php not hard to figure out the loop from here
  6. Dude, think about this for a second. Every mouseover and leave, you are injecting code to start steaming a flash file. For this to work at all, you will need to leave your mouse over the element for awhile, long enough for the file to download
  7. i didnt test this, but somehting like this should be made a sticky window.onload = function(){ //collect your elements var div1 = document.getElementById('div_1_id'), div2 = document.getElementById('div_2_id'), select1 = document.getElementById('select_1'), select2 = document.getElementById('select_2'); //store your elements in an object for easy reference later var element_collection = { 1: div1, 2: div2 } //write simple show/hide function //same code as zanus' except the getElementBYId function isnt called twice each time it is run function showHideElement(show_element){ for(var i in element_collection){ var show = i == show_element ? 'block' : 'none'; element_collection[i].style.display = show; } return true; //hey } //add events to all of your elements. im doing this the old school way select1.onChange = function(){ var value = this.value; showHideElement(value); //ta-da very easy }; };
  8. I've had an iphone for a year now and early on i felt that if it had an extra row of keys for easy access to {} [] - <> ., i could write programs on it.
  9. I'm 28 and I have been [[re]in|un]stalling windows on various boxes since windows 95 -- I have a lot of history with that guy. It really took me getting a mac and using it for a few months to really consider saying "it just works." Of course it isnt perfect, but it is a breeze to use, and the fact that I have *nix under the hood makes for a good day. I'm excited about the OpenCl and grand central dispatch support (both open source), cool things are happening with that tech. http://www.engadget.com/2009/09/17/snow-leopards-grand-central-dispatch-and-opencl-boost-video-enc/ I am a bit biased though as this is my desk (minus the air) (taken with an iphone)
  10. Looking through some of my old threads. I actually used one for about four months earlier this year. Great machine, very very light. When I first got it, I would think that I left it places because it felt like it wasnt in my bag. It did have a industrial design flaw though -- the screen's bevel sat flush on the keyboard area. this caused it to rub against the areas around the mouse button so it would leave markings on the palm rest ----[mouse button]---- --- == markings
  11. Chaining in mootools is easy when dealing with the Fx namespace. Most of the Fx classes fire with a start method, so say you're using Fx.morph you'd do instance.start({ 'height': 300px }).chain(function(){ //some other action }); But mootools is pretty extendible as you can add custom events. A lot of objects have an onComplete event, so when you initialize the object, you define it var x = new Fx.morph(element, { onComplete: function(){ alert('done') }, onStart: function(){ alert('starting') } }); In regards to pure OO MooTools is vastly superior to jQuery. Like the article says -- MooTools does everything jQuery does, but jQuery cannot do everything MooTool does. There are a lot of things that I do not like about jQuery. Why are methods like css() both getters and setters? The common way to code jQuery is to keep running selector after selector instead of creating a reference and using that. My advice is to learn MooTools, jQuery is simple after that
  12. I prefer MooTools (check http://jqueryvsmootools.com/ for a comprehensive comparison). To me it comes down to the building and reuse of js objects The code that you originally posted prototypes (adds) an invoke method to the Array object -- all arrays have a .invoke() method attached
  13. You can actually do some pretty cool stuff with it. if you wanted the function to execute before the first interval call and still have a reference to it that you can pass around, do this (var y = function(){ console.log('xxx'); })(); setInterval(y, 1000);
  14. Actually quotes in this situation shouldnt be used. function x(){ console.log('xxx'); } setInterval(x, 1000);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.