Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
Anyone know how to do this in jQuery?
Drag two separate elements (of numerous element options) into the same drop container and then change what's being displayed based on which two elements the user chose to drag to the container.
[QUOTE=thejjokerr;42257553]Facepunch links don't have underlines until you hover over them. And you can't see the underline when you over over your title because it's set to 10px height while the font is also 10px tall, causing the 1px underline to be clipped.
If you look at KmartSqrl's title under your post you can see his 3-line title also gets underlined, but cut off at the bottom line.
There's not much you can do about it, it's a facepunch problem.[/QUOTE]
TBH, that didn't really answer my question :v:
Why does this not work? Specifically, the "first" and "second" IDs don't use the styles i specified in the external stylesheet.
[code]
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-CA" xml:lang="en-CA">
<head>
<title>Lists</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<div id=”first”>
<span class=”red”>This is a DIV Container.</span>
</div>
<div id=”second”>
DIVs are a powerful way to modularize presentation!
</div>
</body>
</html>
// the external css
#first
{
padding: 5px;
width: 200px; height: 200px;
border-style: dotted; border-width: 2px; border-color: green;
text-align: center;
vertical-align: middle;
position:absolute; left:100px; top:150px;
}
#second
{
padding: 5px;
width: 200px; height: 200px;
border-style: dotted; border-width: 2px; border-color: green;
text-align: center;
vertical-align: middle;
position:absolute; left:10px; top:100px;
}
span.red
{
color: #7D775C;
}[/code]
When i replace #first with div, it works (not the way intended, but it works). Why does it not work when i use the IDs?
[QUOTE=twoski;42272774]Why does this not work? Specifically, the "first" and "second" IDs don't use the styles i specified in the external stylesheet.
[code]
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-CA" xml:lang="en-CA">
<head>
<title>Lists</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<div id=”first”>
<span class=”red”>This is a DIV Container.</span>
</div>
<div id=”second”>
DIVs are a powerful way to modularize presentation!
</div>
</body>
</html>
// the external css
#first
{
padding: 5px;
width: 200px; height: 200px;
border-style: dotted; border-width: 2px; border-color: green;
text-align: center;
vertical-align: middle;
position:absolute; left:100px; top:150px;
}
#second
{
padding: 5px;
width: 200px; height: 200px;
border-style: dotted; border-width: 2px; border-color: green;
text-align: center;
vertical-align: middle;
position:absolute; left:10px; top:100px;
}
span.red
{
color: #7D775C;
}[/code]
When i replace #first with div, it works (not the way intended, but it works). Why does it not work when i use the IDs?[/QUOTE]
It's " not ”
something is wrong with your quotes around the class and id's
[editline]22nd September 2013[/editline]
ninja
I'd like to understand what you can do with javascript and how it works and fits into the little niche of websites and for developing things what you essentially should not try to do with javascript and/or java, also basically the same questions with php/ruby . I'd be really appreciative if anyone would take the time to explain this to me, thank you all.
ffs either my prof used some weird character or it got buggered up when i copied from his site.
Is there a way to center the text vertically without changing any of what i have in the body? vertical-align doesn't seem to change anything.
[QUOTE=id05245;42272983]I'd like to understand what you can do with javascript and how it works and fits into the little niche of websites and for developing things what you essentially should not try to do with javascript and/or java, also basically the same questions with php/ruby . I'd be really appreciative if anyone would take the time to explain this to me, thank you all.[/QUOTE]
Don't have a lot of experience with ruby :v: and java is not really a web development language, but I'll try to answer the parts that I do know.
While web pages made with pure html are static, php and javascript allow you to create dynamic pages.
Javascript allows the webpage to change after it was already loaded, and is usually used to do calculations and/or effects without refreshing/changing the page. You shouldn't do a lot of sensitive things here, since users could change the cody simply by going into the developer view in most/all modern browsers.
Also make sure that you do validations at least once on the php side. Say you have a form and you don't want a user to fill in a letter in a textbox specifically made for numbers, and you made some js to make it so, you should check the value on the php side as well.
PHP is used to *change* the content of a webpage while it's still being loaded on the server. It allows you to, for example, get values from a database, and display it on the webpage.
While writing code in any of these languages, never trust user input. Always validate it, just in case.
How would I use a custom function in a custom function in PHP?
[PHP]
function stuff(){
// Something happens
}
function moreStuff(){
// Something happens aaaaand
stuff();
}
[/PHP]
Like that?
[QUOTE=thejjokerr;42265610]Yes it does. :v
With facepunch links I meant all links on facepunch, including ones in titles.[/QUOTE]
Yes but my current one doesn't get underlined even when I hover, hence why I didn't understand the response :v:
[QUOTE=Moofy;42273600]Yes but my current one doesn't get underlined even when I hover, hence why I didn't understand the response :v:[/QUOTE]
It's because the height of the container is a bit too small and the underline is behind the next block, which makes it invisible.
[QUOTE=id05245;42272983]I'd like to understand what you can do with javascript and how it works and fits into the little niche of websites and for developing things what you essentially should not try to do with javascript and/or java, also basically the same questions with php/ruby . I'd be really appreciative if anyone would take the time to explain this to me, thank you all.[/QUOTE]
Java and JavaScript couldn't be any less related, other than by name
- snip -
[QUOTE=Epiclulz762;42284605]Any suggestions regarding a WYSIWYG in-browser editor?
I am having a look at [url=http://ckeditor.com/demo#standard]CKEditor[/url] who provides an open demo or a standard package for $300.00 or so.[/QUOTE]
Don't pay for that, there's plenty of free alternatives (including one that I forgot the name of, I have it somewhere).
[QUOTE=Epiclulz762;42284605]Any suggestions regarding a WYSIWYG in-browser editor?
I am having a look at [url=http://ckeditor.com/demo#standard]CKEditor[/url] who provides an open demo or a standard package for $300.00 or so.[/QUOTE]
You can use it for free, but if you want premium it's gonna cost. Instead of CKFinder you can use KCFinder
How would i go about making a persistent top banner, sidebar menu and page footer with only html and css?
I've read a bunch of tutorials and from what i've gathered, you use the div tag along with an unordered list to create the side navbar. I'm just confused as to how i'd align it to the side without interrupting the flow of the inner page text.
[code]
<body>
<div id="main">
<div id="menu">
<ul>
<li><a href="#" title="Home" class="home"><span>Home</span></a></li>
<li><a href="#" title="My Page" class="mypage"><span>My Page</span></a></li>
<li><a href="#" title="Friends" class="friends"><span>Friends</span></a></li>
<li><a href="#" title="Photos" class="photos"><span>Photos</span></a></li>
</ul>
</div>
<h3>Title</h3>
<p>Cotnent goes here.</p>
</div>
</body>[/code]
The title/content goes here text always goes under the menu when i want it to align to the inside of the page. Is there some css sorcery i can use to handle this?
And for the top bar, would a <header> tag be appropriate?
[QUOTE=twoski;42285627]How would i go about making a persistent top banner, sidebar menu and page footer with only html and css?
I've read a bunch of tutorials and from what i've gathered, you use the div tag along with an unordered list to create the side navbar. I'm just confused as to how i'd align it to the side without interrupting the flow of the inner page text.
The title/content goes here text always goes under the menu when i want it to align to the inside of the page. Is there some css sorcery i can use to handle this?
And for the top bar, would a <header> tag be appropriate?[/QUOTE]
Use jsfiddle for better help :v:
-snip-
So for a serverside check I need to figure out weather or not
[php]$_SESSION['contentArr'] <> $contentArr[/php]
Problem is that $contentArr['time'] changes every second, so how would I omit it?
- snip -
[QUOTE=gokiyono;42291718]So for a serverside check I need to figure out weather or not
[php]$_SESSION['contentArr'] <> $contentArr[/php]
Problem is that $contentArr['time'] changes every second, so how would I omit it?[/QUOTE]
Compare each field? Unless PHP provides some strange syntax for excluding one member from a comparison of two objects. If the the time field isn't important after the comparison you could just change it in one instance to equal that of the other and then do the comparison.
Or save a temporary version without the time field and then compare?
[php]
$sessContentArr = $_SESSION['contentArr'];
$sessContentArr['time'] = null;
$tempContentArr = $contentArr;
$tempContentArr['time'] = null;
[/php]
Then compare:
[php]$sessContentArr <> $tempContentArr[/php]
Okay so i have a few questions.
[url]http://jsfiddle.net/mwXbQ/2/[/url]
I have to make a skeleton page for what will eventually be a dumbed down version of facebook for my final project. It has to have a top bar, a side bar with links and a footer with a few links in it.
I can't figure out how to make the side links properly fit in their container. Should i make the sidebar fill the entire column it takes up?
[QUOTE=twoski;42297288]Okay so i have a few questions.
[url]http://jsfiddle.net/mwXbQ/2/[/url]
I have to make a skeleton page for what will eventually be a dumbed down version of facebook for my final project. It has to have a top bar, a side bar with links and a footer with a few links in it.
I can't figure out how to make the side links properly fit in their container. Should i make the sidebar fill the entire column it takes up?[/QUOTE]
you should never have to use float in things like this. Use the combination of
[code]display: inline-block; vertical-align: top;[/code]
[editline]24th September 2013[/editline]
[url]http://jsfiddle.net/mwXbQ/3/[/url]
brb actually answering ur problem.
Okay, that works but how do i make the center objects fit next to the menu? Without float, it forces them below the menu.
e: that is perfect, thanks
[QUOTE=twoski;42298407]Okay, that works but how do i make the center objects fit next to the menu? Without float, it forces them below the menu.
e: that is perfect, thanks[/QUOTE]
if you click on the link i posted above, i use the calc()
[url]https://developer.mozilla.org/en-US/docs/Web/CSS/calc[/url]
[editline]24th September 2013[/editline]
Here you go.
[url]http://jsfiddle.net/mwXbQ/5/[/url]
[editline]24th September 2013[/editline]
What I did was make a div around "menu" and "main". Then I set that div as a relative position so the child of this div will be able to set position based on where this div is.
I made the "menu" div's position into absolute and height to 100 or calc(100$ - 5px) because that's what we wanted to have. A "menu" div that would span vertically across the site based on the content.
Then, after that was done, I changed the "main" div by getting rid of the calc() and because I know the set width of the menu is 150px (counting margins and stuff). So, set the margin-left to 150 because the absolute position of the "menu" div will overlap the "main" div and we didn't want that.
Hope that was understand able.
Hi, is it possible to make all usertitles the same size with userscripts? I'm not trying to start shit but some user titles can get really annoying
Pic related [IMG]http://puu.sh/4zIiY.png[/IMG]
[QUOTE=AWarningM;42301560]Hi, is it possible to make all usertitles the same size with userscripts? I'm not trying to start shit but some user titles can get really annoying
Pic related [IMG]http://puu.sh/4zIiY.png[/IMG][/QUOTE]
[URL="http://userscripts.org/scripts/show/132534"]Yes[/URL] there is.
(I have it set as my homepage so I can easily find it.)
[editline]25th September 2013[/editline]
[QUOTE=eternalflamez;42294347]Or save a temporary version without the time field and then compare?
[php]words();[/php][/QUOTE]
I did it a bit differently, and not store $time in the session.
[PHP]
if($_SESSION['contentArr'] <> $contentArr){
$_SESSION['contentArr'] = $contentArr;
$contentArr['time'] = $time;
[/PHP]
Thanks, I thought someone had to have done it before
[QUOTE=AWarningM;42301667]Thanks, I thought someone had to have done it before[/QUOTE]
One day I might buy a title that says that the script on my homepage is the title fixer.
Sorry, you need to Log In to post a reply to this thread.