Contact Andrei Sângeorzan

x Cancel
posted 2 months ago

Help with transforming a bit of code from JQuery to Vanilla JS?

I'm rubbish when it comes to frontend stuff. Come to think of it I'm rubbish period. I have a bit of jquery code that needs to work even on IE7 (yes, I would like to die now). So I thought the best way is to do it in vanilla javascript. The only problem is JQuery is the only thing I kinda, sorta, almost know. Can anyone help me? :D

<script type="text/javascript"> $(document).ready(function(){ $('area.zona1').click(function(){ console.log('zona1'); $('div.zona1').css('display', 'block'); $('div.zona2').css('display', 'none'); $('div.zona3').css('display', 'none'); }); $('area.zona2').click(function(){ console.log('zona2'); $('div.zona1').css('display', 'none'); $('div.zona2').css('display', 'block'); $('div.zona3').css('display', 'none'); }); $('area.zona3').click(function(){ console.log('zona3'); $('div.zona1').css('display', 'none'); $('div.zona2').css('display', 'none'); $('div.zona3').css('display', 'block'); }); $('span.close').click(function(){ $('div.zona1').css('display', 'none'); $('div.zona2').css('display', 'none'); $('div.zona3').css('display', 'none'); console.log('close'); }); }); </script>

Even the above code sucks, but..

EDIT: I swear to god I am going to go and murder some Microsoft idiots. IE doesn't know what console.log is.

posted 2 months ago

Why didn't aPNG catch?

GIFs are old and haven't evolved in the past years. On the other hand, computers and internet speeds are getting better and better.

I always work with PNG images because they have better quality and support transparency, and while GIF also has transparency, its sharpness and range of colours is very limited. In my opinion PNG is superior to GIF. Taking these into consideration, why on earth didn't aPNG catch to the masses? Why isn't it used?

posted 5 months ago

Latest News module in Joomla 1.5

I have a small project in Joomla 1.5. I had to move a site but one particular module refuses to work. It's a module that displays the last X articles on the homepage. A rather small one but I am unable to find why it doesn't work that well. It wasn't made by me :)

<?php // no direct access defined('_JEXEC') or die('Restricted access'); ?>

Now, normally it should display the title and the text (and image if there is any). At the moment it only displays the title. Help? Again, I am a complete noob, so talk accordingly :)

posted 7 months ago

Targetting a single element with jQuery

Well, anything javascript related hates me. So this might seem old news to you, but for me it was like a fresh breath of air. I needed to target a single element that had the same class as others. Solution:

$(document).ready(function(){ $('.feature').hover(

function() {
    $(this).find('.img1').css('display','none');
    $(this).find('.img2').css('display','block');
    console.log('aaa');
},
function() {
    $(this).find('.img1').css('display','block');
    $(this).find('.img2').css('display','none');
    console.log('aa');
Raw

}); });​

I couldn't use CSS because the two images were taken with PHP and were <img src=

posted 1 year ago

Browsers' default CSS rules

I am really interested in finding a list of default CSS rules for every browser out there (or the popular ones).

Is there such a list or will this community be able to make one? After that, it could be expanded to a reset for every browser and also we could create small scripts for every popular coding language that developers could use to serve only the secific reset for every users' browser. This MIGHT help developers in their continuous fight against browser differences!

Would be awesome, right?

posted 2 years ago

When is it best to check cross-browser/OS compatibility?

When you're developing a site, do you check its compatibility on other browsers/operating systemsduring development or at the end when the site is ready? And if you're checking during development, how often is that?

What are your habits? I usually check when I remember, really :P

posted 2 years ago

Design for my secret idea

Right, so @VladFilip made this design for my uber secret legendary awesome idea. I like it very much, he likes it very much, and I'm curious what the noble people of Forrst say. 

The only thing I want to change (more or less) is the font. Looking at this design, what font would you recommend?

Thanks in advance :D

Right, so @VladFilip made this design for my uber secret legendary awesome idea. I like it very much, he likes it very much, and I'm curious what the noble people of Forrst say.

The only thing I want to change (more or less) is the font. Looking at this design, what font would you recommend?

Thanks in advance :D

posted 2 years ago

Bilingual site pt. II

                if (!isset($_COOKIE['lang'])){
	if ($locations['countryCode'] == 'RO')
		{//echo "Esti roman.";
		 setcookie("lang", 'ro', time()+60*60*24);
		}
	else
		{//echo "You are most likely an English speaker :)";
		setcookie("lang", 'en', time()+60*60*24);}
}

if ($_COOKIE['lang'] == 'ro')
echo "Esti roman. <a href=\"\" onClick=\"javascript:document.cookie='lang=en'\">Schimba</a>.";
else
echo "You are most likely an English speaker :). <a href=\"\" onClick=\"javascript:document.cookie='lang=ro'\">Change</a>.";                
Raw

I've began coding the site I was talking about here. It worked much better than I could've hoped! But, of course, there is a problem. I have a romanian IP. If there is no cookie set (ie first entry on the site) I see the english part. Before reloading the site I look at the cookie value and it is "ro", so the site should be in romanian.

Any ideas why I see english when I should be seeing romanian? If I refresh the page it's ok. If I manually change the language, everything is fine an dandy. Just that small bug, somewhere... Any ideas?

posted 2 years ago

Building a multilingual site

In the near future I will have to code a bilingual site, and I haven't done this before so it's a new challenge I am ready to take. I've come up with a few ideas on how to make this, as follows:

Method ONE

This is the straight-forward method. Two separate sites, the second one being in a separate folder. And a simple cookie to remember users' choice. This would be the simplest, but modifying will be a pain, since I will have to modify in two places.

Method TWO

Setting up the design and loading the text in both languages from a database, based on a "?lang=" parameter. A bit harder than the first way, but more profesional. Also a pain to change text, because I have to use phpMyAdmin to do so.

Method THREE

Setting up the design and loading FILES with the translated text, including them (if you will), also based on a language parameter. No idea if this is a good method or even if it's possible, but as far as I know everything is possible :)

I will also look up for stuff on Google, but I just want to hear what you have to say :)

So, what method do you recommend? Any other methods?

posted 2 years ago

Becoming a Freelancer

We're two friends who want to start freelancing. I am the code guy, my mate is the design guy. He is very good in what he does, whilst I am average in what I do, but willing to learn as much as I can (if I get caught in my coding, no sleep, no food, etc).

Today I was talking to him about getting started and just wanted some tips. And I think Forrst is the best place to get these tips.

What are your best tips for someone who wants to become a freelancer?