Monthly Archives: آبان 1392

Answer by Nasser Torabzade for Read the click event of the anchor tag in fancybox 2 title

you are binding an event to an element that does not exist at the time of binding the event, that's not gonna work. you need to bind your event to a parent element that exists when document is ready.

$(PARENT_ELEMENT).on("click","#tb2fb",function(){
      alert("RIP");
});

safest way is to use body as PARENT_ELEMENT in above code.

Theft & Iteration

How I learned web design. In the beginning, I already knew how to program (albeit in different languages) and what I knew of design was only related to print/layout (yes I’m that old). Everything I taught myself about web design was stolen from other websites. I looked at the layouts of other websites and would replicate them in photoshop. And then replicate them again to see if I could improve and speed up my process. Then replicate them again to see if I could improve the way they looked. Sometimes 100s of times. All on the privacy of my computer, not on a client’s dime. I did the same for code. I’d look at someone else’s source code and write it out again for myself. Then I’d try and write the same source from scratch. Then I’d try and improve the code, or morph it to work with the updated designs I had done. Once I felt I had a good grip on taking and replicating single sites, I moved onto stealing multiple sites and using the best elements and code in my experiments. And I’d do the same thing, draw them, then draw them again, and draw them again. Mashups of several sites, merged into one consistent design. I’d do this until I was happy with the process and the time it took, and happy with the changes I had made to them to make them look better. And by the time I’d be done, the result wouldn’t look like any one specific site I had stolen from. Not much has changed between and than doing web design professionally. I still steal ideas to kick-off my own. Mostly I steal ideas from nature, clothes, magazines, books, architecture, art. But I do see good ideas on the web for small pieces and lift them completely. Then iterate them over and over until I get something I’m happy with, which invariably looks and works different from it’s source. There’s no need to be concerned with a process like this in the beginning. Especially if you’re teaching yourself something. Steal entire ideas. Shamelessly use them as a base or starting point (although I don’t recommend using these for profit). Iterate on them until you’re comfortable with your process. The iterate more on what you think would work better. Then steal from lots of sources and do the same thing. Iterating until the process is sound and the end result has embodies your voice and creative hand as well. This way you don’t have to worry about being inspired or finding a muse at the start. Your muse is other work and other work is abundant. That way you only have to worry about adding your story and flavour to something existing, instead of starting with a blank slate. It’s difficult to sit at a blank screen and simply create. It’s daunting and even terrifying. Starting with something that already exists and riffing on it until it’s your own can create the spark required to start. When I break it down, that’s exactly how I’ve learned everything I know. Through theft and iteration.

Answer by Nasser Torabzade for Javascript: Display the result in a pop up message/message box

one approach is to have contents that you want to be popped up, in a div with display:node, then when the radio button is clicked, popup that dialog using a jQuery plugin like fancybox:

<div id="popup" style="display:none;">PLAYLIST</div>

$(document).ready(function(){
    $(RADIO_BUTTON_ELEMENT).click(function(){
        $("#popup").fancybox();
    }
});

Answer by Nasser Torabzade for Capture window state in a form,

I'm not sure, but this might be the answer: try to add your hidden field statically to html, with a null value. then set its value dynamically using jQuery:

<td align='left' width='100'>
<form action='print_plan.php' method='post' name='printplan' target='_blank'>
<input type='hidden' id='PlanNo' name='PlanNo' value='13' />
<input type='hidden' id='IDuser' name='IDuser' value='1' />
<input type='hidden' id='detCols' name='detCols' value='' />
<input name='Submit' type='image' value='print' title='Print Plan'  src='images/print.gif'
           alt='Print Plan' onclick='detailCols()' />
</form>
</td>

jQuery

$(document).ready(function(){
    $("#detCols").val(details);
});

Theft & Iteration

How I learned web design. In the beginning, I already knew how to program (albeit in different languages) and what I knew of design was only related to print/layout (yes I’m that old). Everything I taught myself about web design was stolen from other websites. I looked at the layouts of other websites and would replicate them in photoshop. And then replicate them again to see if I could improve and speed up my process. Then replicate them again to see if I could improve the way they looked. Sometimes 100s of times. All on the privacy of my computer, not on a client’s dime. I did the same for code. I’d look at someone else’s source code and write it out again for myself. Then I’d try and write the same source from scratch. Then I’d try and improve the code, or morph it to work with the updated designs I had done. Once I felt I had a good grip on taking and replicating single sites, I moved onto stealing multiple sites and using the best elements and code in my experiments. And I’d do the same thing, draw them, then draw them again, and draw them again. Mashups of several sites, merged into one consistent design. I’d do this until I was happy with the process and the time it took, and happy with the changes I had made to them to make them look better. And by the time I’d be done, the result wouldn’t look like any one specific site I had stolen from. Not much has changed between and than doing web design professionally. I still steal ideas to kick-off my own. Mostly I steal ideas from nature, clothes, magazines, books, architecture, art. But I do see good ideas on the web for small pieces and lift them completely. Then iterate them over and over until I get something I’m happy with, which invariably looks and works different from it’s source. There’s no need to be concerned with a process like this in the beginning. Especially if you’re teaching yourself something. Steal entire ideas. Shamelessly use them as a base or starting point (although I don’t recommend using these for profit). Iterate on them until you’re comfortable with your process. The iterate more on what you think would work better. Then steal from lots of sources and do the same thing. Iterating until the process is sound and the end result has embodies your voice and creative hand as well. This way you don’t have to worry about being inspired or finding a muse at the start. Your muse is other work and other work is abundant. That way you only have to worry about adding your story and flavour to something existing, instead of starting with a blank slate. It’s difficult to sit at a blank screen and simply create. It’s daunting and even terrifying. Starting with something that already exists and riffing on it until it’s your own can create the spark required to start. When I break it down, that’s exactly how I’ve learned everything I know. Through theft and iteration.