Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
[QUOTE=aerochug;33779157]I'm probably doing something wrong here, but does anybody know why the on() method in jQuery is not working for me?
[url]http://jsfiddle.net/a/J2MQy/[/url]
This works:
[code]
$('.comment').hover(function() {
$(this).css({'border-bottom':'1px solid #999'});
}, function() {
$(this).css({'border-bottom':'1px solid #ccc'});
});
[/code]
But I need to use the on() method as it needs to apply to elements in the future too i.e. those that have been dynamically created.
So I tried this code:
[code]
$('.comment').on('hover', function() {
$(this).css({'border-bottom':'1px solid #999'});
}, function() {
$(this).css({'border-bottom':'1px solid #ccc'});
});
[/code]
But it doesn't seem to work. Anyone know why?[/QUOTE]
you can try [code]
bind('hover',function() { }
[/code]
I haven't used CSS in Jquery in such way yet, I'd rather use this:
[code]$('.comment').on('hover', function() {
$(this).css('border-bottom','1px solid #999');
}, function(){
$(this).css('border-bottom','1px solid #ccc');
});[/code]
I've made an inventory system where I can store how much time I've spent on an object. The time format is 00:00:00 (HH:MM:SS).
I would need some way to start a timer, either from 00:00:00 or the stored time and then be able to stop and reset it.
Javascript? But I've never used it...
[img]http://dl.dropbox.com/u/5342745/editItem.png[/img]
[QUOTE=kragmars102;33781254]you can try [code]
bind('hover',function() { }
[/code]
I haven't used CSS in Jquery in such way yet, I'd rather use this:
[code]$('.comment').on('hover', function() {
$(this).css('border-bottom','1px solid #999');
}, function(){
$(this).css('border-bottom','1px solid #ccc');
});[/code][/QUOTE]
Hm, thanks for looking into it but bind() doesn't seem to work either :( And it looks like it's deprecated (on() is preferred according to the jQuery docs, but that doesn't work because I'm probably doing something wrong)
Are you testing it on an local .html file or that site? If you're using that site try use a local .html file.
[QUOTE=kragmars102;33781840]Are you testing it on an local .html file or that site? If you're using that site try use a local .html file.[/QUOTE]
I'm testing it on a local file, but I get the same results when I upload it to my website. I've tried on(), bind(), delegate() and live() and none of them seem to work. Only click(), hover() etc work.
Hi,
I haven't worked with html or css in almost 4 years so I guess I'm a little rusty.
I'm trying to put a background into this html file:
[CODE]<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id=header>
<p>Header</p>
</div>
</body>
</html>[/CODE]
this is my css:
[CODE]body {
background-color:black;
margin:0px;
padding:0px;
}
div#header {
border-bottom-width: 4px;
border-bottom-style:solid;
background-image: url(../images/bg.jpg);
background-repeat:repeat;
border-bottom-color:white;
color: white;
font-size: 12pt;
vertical-align: top;
font-family:Arial,sans-serif;
height:18px;
margin-left:px;
margin-bottom: 1px;
padding: 0px;
padding-left: 15px;
}[/CODE]
you can use
html{
background:#000;
}
(body usually only contains the content, not the whole page.)
oh ok i completely misinterpreted
Whenever you use a method like .on(), .bind(), .delegate() or the deprecated .live() in jQuery, it [i]only attaches[/i] the event handler to that specific element. You must trigger it yourself with [url=http://api.jquery.com/trigger/]jQuery's .trigger() method[/url].
EDIT: Hm, scratch that. I'm probably doing something wrong again here, but the trigger thing just makes my browser go crazy and my CPU usage goes to 100%. I think it is being called repeatedly for some reason.
EDIT 2: This seems to be very helpful: [url]http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F[/url] and specifically deals with the issue I am trying to resolve. Thought I'd edit my post with it incase someone stumbles on this post in the future and has the same problem as me.
[QUOTE=Kwaq;33783691]you can use
html{
background:#000;
}
(body usually only contains the content, not the whole page.)[/QUOTE]
Thank you for your tip but actually I'm looking for a way to fix the issue that the header part does not accept the image as background.
[QUOTE=ctlilc;33783965]Thank you for your tip but actually I'm looking for a way to fix the issue that the header part does not accept the image as background.[/QUOTE]
Shouldn't the path be in quotes?
Yeah thank you.
background-image: url('bg.png'); did the trick.
[QUOTE=Armandur;33784030]Shouldn't the path be in quotes?[/QUOTE]
not always i think you can have them outside of quotes
[editline]18th December 2011[/editline]
[QUOTE=ctlilc;33784761]Yeah thank you.
background-image: url('bg.png'); did the trick.[/QUOTE]
that's weird url without quotes normally works for me
[img]http://puu.sh/aXj2.png[/img]
Seems you guys where right, and Hexxeh's VPS's are amazing compared to my previous host, thanks for your help guys :)
Think I can squeeze wordpress on there?
What are you running on it now?
[QUOTE=itsbth;33787038]What are you running on it now?[/QUOTE]
10 Person TS3 (which never reaches near 10), Apache2, vsftpd, PHP, Mysql, PHPmyadmin, and I think that's it.
[QUOTE=Adzter;33787192]10 Person TS3 (which never reaches near 10), Apache2, vsftpd, PHP, Mysql, PHPmyadmin, and I think that's it.[/QUOTE]
Have you considered switching server software? While nginx is a bit harder to set up, it uses significantly less memory. That being said, I don't think installing Wordpress would be too much of an issue.
[QUOTE=itsbth;33788020]Have you considered switching server software? While nginx is a bit harder to set up, it uses significantly less memory. That being said, I don't think installing Wordpress would be too much of an issue.[/QUOTE]
apache can be set up to use less memory, and php-fcgi is an absolute whore
[QUOTE=itsbth;33788020]Have you considered switching server software? While nginx is a bit harder to set up, it uses significantly less memory. That being said, I don't think installing Wordpress would be too much of an issue.[/QUOTE]
I've considered it actually, but since I'm pretty much very new to Linux and running a VPS, I think it might be best for me to stick with Apache whilst I figure out the more complex stuff.
EDIT: After a reboot I'm on 140MB free, wierd.
[QUOTE=swift and shift;33791144]apache can be set up to use less memory, and php-fcgi is an absolute whore[/QUOTE]
While you can indeed make it use less RAM, you won't get the same bang for your buck with Apache. Nothing wrong with php-fcgi that I've encountered. I also find nginx simpler to set up but that's mainly because its configuration isn't Fucking Weird.
What's a good place to learn Ruby / RoR?
[QUOTE=zzlawlzz;33796040]What's a good place to learn Ruby / RoR?[/QUOTE]
For RoR, [url=http://railsforzombies.org/]this site[/url] is great.
Would you say social networks like facebook works like:
Each user has his own Database which includes all his photos, info, groups, videos etc..
So that server ends up with millions of databases.
or
There is specific database lets say called: Photos, and it stores all photos of all users?
So that server ends up with just a few databases?
I just learned XHTML and CSS, and started learning php, javascript and mysql, so I am just wondering out of interest how that works out. Any ideas?
[QUOTE=arleitiss;33805541]Would you say social networks like facebook works like:
Each user has his own Database which includes all his photos, info, groups, videos etc..
So that server ends up with millions of databases.
or
There is specific database lets say called: Photos, and it stores all photos of all users?
So that server ends up with just a few databases?
I just learned XHTML and CSS, and started learning php, javascript and mysql, so I am just wondering out of interest how that works out. Any ideas?[/QUOTE]
You have database which holds tables. The tables are called user, photos, videos etc. The tables consist of rows, which hold the data. username, path to profile picture path to photoalbum etc.
Is there any way to define a favicon for an image? I have a file uploading site and when you visit linked images/other content directly on Chrome, the favicon looks like Google's "g". Any way to change this?
I was wondering if anyone can explain some business parts of freelance web design work, I know some people here have experience with this. I'm a college student who might start doing work for small, local companies.
Specifically, after you develop a site design for someone and send it to them, if it's someone who has never dealt with HTML, CSS etc., how do you handle content updates when the time eventually comes? I guess they contact you again and you charge them an hour or whatever?
[QUOTE=atl101;33808675]I was wondering if anyone can explain some business parts of freelance web design work, I know some people here have experience with this. I'm a college student who might start doing work for small, local companies.
Specifically, after you develop a site design for someone and send it to them, if it's someone who has never dealt with HTML, CSS etc., how do you handle content updates when the time eventually comes? I guess they contact you again and you charge them an hour or whatever?[/QUOTE]
It's up to you and the client, just make it clear from the get-go. You can include extended support in your original contract (so for example, you'd cover a fee that would include 3 months of free(bad idea)/discounted support work), or simply do it at your normal rate, as if it were any other job.
[IMG]http://i.imgur.com/xTHekl.png[/IMG]
IS there a way that I can create variables that belong to a post?
In the image, you'll see blue and red boxes.
In the blue, I want to store a list that i can add an infinite amount of items to.
In the red boxes are pitures with radio button underneath.
these are just arguments/parameteres/properties that I want to be able to access when printing the post on a page. Is that possible?
Also, what's the best way to have multiple people run a single wordpress. I need different faces on each post. Different names as well
[QUOTE=Sprite;33817100]
Also, what's the best way to have multiple people run a single wordpress. I need different faces on each post. Different names as well[/QUOTE]
You can register a blog to more than one wordpress account. Those people can edit it, their name/face will show up on whatever posts they personally make. Send invites to different users.
How would you guys make the little triangle thing on the bottom of this?
[img]http://gyazo.com/9d449fb08d4c77faa04505226cdfb782.png[/img]
[QUOTE=AMD 32;33836260]How would you guys make the little triangle thing on the bottom of this?
[img]http://gyazo.com/9d449fb08d4c77faa04505226cdfb782.png[/img][/QUOTE]
Make the whole grey bit part of a background image
Sorry, you need to Log In to post a reply to this thread.