floatingDivs 21 Junior Poster

Duh! Why do you think I posted this request - of course pulling in the three different JQuery files stops all versions working - so... Im looking for some advice/help/assistance on how to reference one Master file which will enable all three functions to work on the page...

So... do you have the answer ? Or do you just state what I already know ?

Well, I'm left speechless. You have the audacity to throw insults around when requesting help. Even worse, you're doing so after 20 days have passed and you've been unable to come up with a solution. Laughable.

Consider reading my post more closely and try to think about what I'm saying. If each JavaScript file references its own jQuery, you're loading 3 different copies -- which you claimed you knew -- and yet you're confused as to why you're having issues? You should be loading only one copy of jQuery to prevent conflicts.

As for a possible solution, consider removing the references to jQuery made by each file and just include a <script> pointing to jQuery.

floatingDivs 21 Junior Poster

That's cool. It just seems weird that you skipped over discussing the Doctype.

As for getting off your back, I wasn't on it. You're the first person that's ever shown any hostility towards my posts, and I've been "rude" -- something I wasn't with my previous post -- to people on here.

Then again, after checking out your site (which is a template you downloaded from midphase.com), which led me to Twitter, which led me to your "donation" post, I can see why you're hasty. Your potential clients may read that you forgot to include a very important part of web coding and it doesn't look good, right?

Also, your "expertise" (as much as you can have as a 16-year old, I guess...) isn't really needed, as this "donation" (tutorial) you are providing is basically found on htmldog.com, Mozilla's HTML development site, and a host of others (including the aforementioned w3schools.com), but that's just me.

Now I'm on your back. ;)

floatingDivs 21 Junior Poster

No offense, but couldn't someone read all of what you've written on w3schools.com/html? Heck, it's all available on the first couple pages...

Also, Arkinder made a great point. You're teaching people to code, but you forgot the DOCTYPE?!?!

Lastly, stop cussing in your posts.

floatingDivs 21 Junior Poster

Appears to work for me now.

function nextPicture() {
				currentImage = currentImage + 1;
				
				if(currentImage < mainPictures.length) {
					$("#pic_1").fadeOut(2000, function() {
						$(this).attr("src",mainPictures[currentImage]).fadeIn(2000);
					});
				} else {
					currentImage = 0;
					$("#pic_1").attr('src',mainPictures[0]).fadeIn(2000);
				}
				
				alert(currentImage);
			}
floatingDivs 21 Junior Poster

Try this.

<script type="text/javascript">
	function multiply() {
		document.getElementById('text3').value = document.getElementById('text1').value * document.getElementById('text2').value;
	}
</script>
<input type="text" id="text1" onkeydown="multiply()" />
<input type="text" id="text2" onkeydown="multiply()" />
<input type="text" id="text3" />
floatingDivs 21 Junior Poster
<script type="text/javascript">
	function multiply() {
		document.getElementById('text3').value = document.getElementById('text1').value * document.getElementById('text2').value;
	}
</script>
<input type="text" id="text1" onmouseout="multiply()" />
<input type="text" id="text2" onmouseout="multiply()" />
<input type="text" id="text3" />
floatingDivs 21 Junior Poster

An array starts at 0, not 1. So, you need to calculate from 0 to whatever the last element in your array is (you actually don't...read below to find out how to save yourself time). Even though the image is gloom_full_27.jpg, the array index is 26. Remember, gloom_full_1.jpg is located at element 0, not element 1. So, what the function nextPicture was doing is this; it compared the currentImage variable value (0-xx) against the hard-coded integer 27 (which we also remove...explained below). The problem is, your array has 26 (0-26, not 1-27) elements! I'm guessing that broke your code since the array went out of bounds (past its last element).

Also, hard-coding an array length is inefficient and not necessary. What if you add 3 more images but forget to change that value from 26 (remember where arrays start!) to 29? You've added those images, but they won't show! Thankfully, JS has a length function built into it's language. So, instead of needing to change that value manually any time you add/remove pictures from your array, you simply place the array's length as the comparison in favor of the hard-coded integer.

array mainPictures has 26 elements. Instead of writing 26 in the IF statement in function nextPicture, write mainPictures.array. You'll see what I mean when you view the code. :D

I'm betting you were seeing no image when you clicked the NextPicture link the 28th time. :P I'm GUESSING the function broke your page and it didn't …

floatingDivs 21 Junior Poster

Are they all referencing a jQuery file? If so, you'd be pulling in 3 diff. copies of jQuery, which would cause it to stop working unless you use a function that loads only one version of it.

floatingDivs 21 Junior Poster

Hi Violet82,

This should be what you're looking for.

// load images
var mainPictures = ["images/gloom_full_1.jpg", "images/gloom_full_2.jpg", ... "images/gloom_full_27.jpg" ];
var thumbPictures = ["images/gloom_thumb_1.jpg", ... "images/gloom_thumb_27.jpg"];
var thumbShadedPictures = ["images/gloom_thumb_shad_1.jpg"... "images/gloom_thumb_shad_27.jpg"];

// counter
var currentImage = 0;

// set picture to be 1st element in array (gloom_full_1.jpg)
$("#pic_1").attr('src',mainPictures[currentImage]).fadeIn(2000);

function nextPicture(){
	$("#pic_1").fadeOut(2000, function(){
		$(this).attr("src", mainPictures[++currentImage]).fadeIn(2000);
	});
}
floatingDivs 21 Junior Poster

Hey guys,

I've spent the last 20 or so minutes developing an OOP cookie-setting script. Unfortunately, even though everything I'm printing out via alert looks correct, the cookie won't set.

Can someone take a look and see where I've made a mistake?

<script type="text/javascript">			
	function Cookie(){
		this.cookieName;
		this.cookieExpiration;
		this.cookiePath;
		this.cookie;
		
		this.setName = function(name, value){
			this.cookieName = name + '=' + value + '; ';
			return this; 
		}
		
		this.setExpirationDate = function(){
			var date = new Date();
			date.setTime(date.getTime());
			this.cookieExpiration = 'expires=' + date.toGMTString() + '; ';
			return this;
		}
		
		this.setPath = function(path){
			this.cookiePath = 'path=/';
			
			return this;
		}
		
		this.createCookie = function(){		
			alert("'" + this.cookieName + this.cookieExpiration + this.cookiePath + "'");			
			this.cookie = "'" + this.cookieName + this.cookieExpiration + this.cookiePath + "'";
			document.cookie = this.cookie;
			alert(document.cookie);
		}
	}
	
	var cookie = new Cookie();
	cookie.setName('name1', 'val1').setExpirationDate().setPath().createCookie();
</script>
floatingDivs 21 Junior Poster

Regarding the state information, here's a link.

http://www.dhs.state.il.us/page.aspx?item=32765

Thanks for your advice, Pro2000, but we're pretty darn good with HTML and I have full confidence in our ability to mimic table-layouts with unordered lists (for the most part). Plus we hired a fantastic designer who's going to create sketches for us that we'll use to layout the data in an appealing way.

As for lists in general, the accessibility group is completely "pro-list". So, I think we're good.

Once again, thanks to everyone who contributed!

floatingDivs 21 Junior Poster

We've decided we're going to go ahead and try using either lists or divs to create the design because our campus requires accessibility that is verified by the state. Plus, we have some of the brightest minds in the fields of accessibility working with us, so I don't think it will go badly at all.

Thanks for your help, man!

floatingDivs 21 Junior Poster

Hey guys,

Sorry to bump a 7 month old thread, but I don't want to create a new thread with pretty much the same question.

The reason we want to "reinvent the wheel" so to speak is because accessibility is the most important thing. There is just no way tables are the best way to go when we aren't providing tabular data in any way, shape, or form. Our clients, while mostly non-disabled, also consist of people without sight, so screen-readers need to be able to navigate the entire "content" properly.

At the same time, we do want it to look great and have a lot of functionality, and for that we will probably look to vBulletin as inspiration. But the layout DOES need to change. Also, paid or open-sourced software isn't an option because we have our own data generation (XML) and use XSLT to display the data. We don't work with PHP or ASP.net but rather Java & Tomcat.

floatingDivs 21 Junior Poster

i think ssd and os not work make together. but try

What in the world? Considering SSD's use SATA connectors just like HDDs, yes they will.

I'm currently running a 60GB SSD for the operating system (and FIFA 11!) and use my 1TB secondary drive to store my videos, pictures, and other files (as well as all my applications!)

floatingDivs 21 Junior Poster

Create a new web page with the code below.

<html>
<head>
<style type="text/css">
.maintable
{
[B]position:absolute;[/B]
top:20px;
}
body { height: 1000px; }
</style>
</head>

<body>
<h1>This is a heading</h1>
<table class="maintable">
<tr>
<td>00001</td>
<td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td><td>00001</td>
</tr>
</table>
<table>
<tr>
<td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td>
</tr>

</table>
</body>
</html>
floatingDivs 21 Junior Poster

drjohn,

Are you sure it's invalid? Appears to work fine for me. Please consider actually TESTING the code before spewing the kind of crap you did above.

Thanks!

P.S. I'm just joking! :P

floatingDivs 21 Junior Poster

Change position from fixed to absolute.

floatingDivs 21 Junior Poster
floatingDivs 21 Junior Poster

Hi Riteman,

It's failry easy to get the "total" from two fields and output it into a third field.

<script type="text/javascript">
function calculateCost() {
var cost = parseInt(document.getElementById("cost").value);
var quantity = parseInt(quantity.getElementById("quantity").value);
var total = parseInt(document.getElementById("total").value);

total.value = cost * quantity;
}
</script>

<input type="text" id="cost" value="200" disabled />
<input type="text" id="quantity" onkeydown="/>
<input type="text" id="total" disabled />

floatingDivs 21 Junior Poster

Hey guys,

I need some help in regards to Dreamweaver's Live View and Absolute Paths. A new co-worker just had Dreamweaver installed and was trying to work with a single page that had all absolute paths for CSS links (meaning http://mysite.com/styles.css instead of /styles.css as the link) and still wasn't able to see the CSS, instead being met with a white page (no styling whatsoever) and the content. I would assume absolute paths would be exactly what she'd need to use without having to create a local folder to hold the styles.css link and point to it relatively.

Is there an option we have to turn on or something?

She's using the most up-to-date Mac OS available.

Thanks!

floatingDivs 21 Junior Poster

I believe the problem lies with using framesets. I don't think IE9 supports them in any way, shape, or form. I tested out the page by removing snippets of code at a time and after deleting the frameset, the page "worked", albeit displayed empty. A little research on Google confirms my theory.

floatingDivs 21 Junior Poster

twiss,

Thank you very much for your help. I'll continue looking around on the web for a solution.

Have a nice day!

floatingDivs 21 Junior Poster

Would you mind testing this page to see if you get the message asking "Would you like to add to Home Screen?"

https://m.google.com/app/buzz

It's their new social media site (I think). It doesn't appear when using an iPod Touch but according to Java Ranch, it does work with an iPhone (so smart phones too, right?)

floatingDivs 21 Junior Poster

Thank you for such a fast response! This will be tested in a couple minutes and you will have points added.

Apologies if the previous post sounded patronizing, it wasn't intended to.

floatingDivs 21 Junior Poster

Hi twiss,

Thank you for your response!

The feeling is that you may have misunderstood the question. What we're interested in is getting our site "bookmarked" onto the home screen (do you have a smart phone? it's the "desktop" where you see all your icons.) if the user says "Yes" to the message. The message itself isn't important. Unfortunately, all information on the web says it's impossible to use programming of any sort to allow your site to be bookmarked to the home screen, despite evidence to the contrary.

floatingDivs 21 Junior Poster

Hello everyone,

This question is in regards to mobile websites and the "Add to home screen" functionality. The mobile version of the site has been finished, but it's been suggested that the feature be implemented into the site as well. Despite the information available to the contrary, it's definitely possible to use some sort of programming to ask the question "Would you like this page added to the Home Screen?" seeing as how the colleague has seen it on major websites. Unfortunately, the colleague cannot seem to remember which sites it was available on, but the hope is one or some of you may have some suggestions. This was not a web app, but a web site.

EDIT
While a sub-board catering to mobile technology is available on Daniweb, I much prefer using this board seeing as how it's much faster in responding and deals much more closely with the subject.

floatingDivs 21 Junior Poster

I agree with russ_nbhs! chrisea, you're a fool and a prick for not being able to understand the fairly clear and obvious questions posed by russ_nbhs. He knows enough to get the scripts to work, but doesn't know how to actual code with them (lol). Also, just because you know a lot about these things doesn't mean you know everything about it.

/sarcasm

My suggestion is just to ignore the little brat until he a) apologizes for being a prick and b) asks a clear and concise question. You want to prettify your site? Go read CSS tutorials.

floatingDivs 21 Junior Poster

Hi Griffin,

I took a look at your code and see a problem. You have set the CSS for paragraph tags (<p>) to have a large height and great deal of padding associated with them. Then, you placed it directly before "Pre-order before July..." which caused a huge amount of white-space to appear in the content area. Removing that should help a little.

As for content being centered, you should set the <p> tag for whichever paragraph you want centered to have a margin-left and margin-right of auto.

floatingDivs 21 Junior Poster

DeIntegro,

The reason you're only getting one row is because you're querying for one row. You need to query an array of rows.

$row = mysql_fetch_[b]row[/b]($result);

should be

$row = mysql_fetch_[b]array[/b]($result);
floatingDivs 21 Junior Poster

Are you "floating" anything like divs or lists? If so, you need to clear them.

Do you have an example page you can show?

floatingDivs 21 Junior Poster

I'm guessing you found the thread via Google Search, Jkreifels.

From here on out, try not to "bump" topics over 3 years old.

floatingDivs 21 Junior Poster

This MAY or MAY NOT work, but have you considered using one of those standardized "reset" CSS stylesheets?

http://meyerweb.com/eric/tools/css/reset/

You'd simply place that CSS above everything else (thus it would get overriden by stylesheets underneath it when it needs to). What it does is get the browsers as close as possible to each other in terms of margin/padding/etc before you code CSS.

Basically, if that's too hard to understand (it is even for me!), read up on "reset CSS".

floatingDivs 21 Junior Poster

the prince Awah,

You clearly do not seem to understand that we don't wait for you to beckon us for help. I'm sorry you feel as though the world (specifically Daniweb) owes you this huge favor of doing the work for you, but I doubt anyone with any self-respect will help you after you managed to insult the entire board.

Secondly, in response to your question about what kind of web developers we are, I think it's fair to say we're far superior to you. The fact that YOU came to US for help should tell you this much, genius.

Lastly, I think the problem is fairly obvious, but I'm not going to give you an easy answer.

Instead, you can read this article and figure out the solution on your own, kiddo.

http://css-tricks.com/all-about-floats/

floatingDivs 21 Junior Poster

How about a soda machine? Insert coins, count money, see if any needs to be returned, and choose a candy bar. The thing is, every time they buy one, you need to keep track so that they can run out. Use a txt file to keep track of it. So, if I run the program today and choose a cola, you have 9 colas remaining in the machine. If I run the program a week from now, you'll have 8 remaining.

Should be fairly simple.

floatingDivs 21 Junior Poster

Hey guys,

I'm interested in PHP and was wanting to get better. I figure there is at least a handful of active members who are college students and wouldn't mind learning more PHP. My offer is to create our own, unique, open-sourced educational CMS similar to Blackboard or Angel. It would strictly be for educational purposes and we'd be learning to collaborate as a group, which could only help you in the future. We'd divvy up the work equally and communicate regularly via chat/discussion and more importantly, stay motivated because it wouldn't be just you coding by yourself and losing focus. We'd outline a big goal, plan accordingly, and try our very best to make one. Now, why should we do this? Simply put, it would look fantastic on a resume and if even one college picked it up, we'd really have a solid backing.

If no ones interested, that's fine. However, it's very hard to do things on your own (as you may or may not know) and working together would get a lot more work accomplished at a much more rapid pace.

If anyone's interested in collaborating, let me know by replying back.

A couple requirements would be that everyone is capable of communicating in English, has some knowledge with HTML/CSS (which you should if you know PHP), and a good understanding of databases. A couple strengths we could use are AJAX/jQuery/designing for a "prettier" front-end.

floatingDivs 21 Junior Poster

Hey guys,

This may be entirely impossible, but I've been wanting to shore up the security of a Wordpress CMS for a family friend. Obviously, anyone who goes to http://site.com/wp-admin will see a login screen, which MAY be susceptible to potential hacking. What I'd like to do is the following.

Outlaw direct access to http://site.com/wp-admin...if someone tries it, they get a "Page not found" or similar message. Then, a secret link http://site.com/loginscreen would automatically re-direct to wp-admin and it would work.

Is something like that possible?

TLDR version

1. site.com/wp-admin (not available)
2. site.com/loginscreen (available) redirect to site.com/wp-admin (available)

Thanks!

floatingDivs 21 Junior Poster

This looks like something you may be searching for.

floatingDivs 21 Junior Poster

Hi Daniweb,

I'm looking to read in a file, but "ignore" the label prefixed to data.

For instance, if I have the following on one line, I want to ignore "Cities:" but read in the rest.

Cities: Chicago, New York, Atlanta

If someone can point me in the right way, thanks! Otherwise, no biggie.

floatingDivs 21 Junior Poster

Looks good

Thanks for looking it over! I suffer from pretty bad OCD (checking & rechecking if doors are closed, books are in alphabetical order, TV remotes parallel, etc...etc...etc) and I checked and re-checked the assignment too many times to count. This is only one of the three such examples and I didn't want to have someone check the WHOLE assignment.

Thanks a bunch for such a fast response. The other two are "harder" (more complex), but now that I've been assured I"m on the right track, I think I'll go turn in my assignment.

floatingDivs 21 Junior Poster

Well, I'm guessing you see the actual data in all browsers, but you don't see a BORDER in IE, correct? If so, that's fairly obvious. You've set "border" to "none", but used browser-specific CSS to create rounded corners for Safari/Chrome and Firefox browsers.

Set "border" to "1px solid #000" and see if that helps.

floatingDivs 21 Junior Poster

Hi guys,

I just finished doing my homework assignment on spanning trees and I wanted some reassurance that I've done it correctly. I'm not looking for someone to state a correction, but rather let me know I've made a mistake (if I have).

Here are my edges for Prim's Algorithm
(1,2) - (1,5) - (5, 7) - (7, 11) - (7, 8) - (8, 4) - (2, 3) - (11, 13) - (3, 10) - (10, 12) - (12, 9) - (12, 14)

Here are my edges for Kruskal's Algorithm
(7, 11) - (1, 2) - (10, 12) - (4, 8) - (7, 8) - (9, 12) - (1, 5) - (5, 7) - (2, 3) - (12, 14) - (11, 13) - (3, 10) - (5, 6)

floatingDivs 21 Junior Poster

In JavaScript, something like this would insert "Hello World" into an element.

var element = document.getElementById('content');
element.innertHTML = "Hello World";

(Something like that...I'm not great at JS)

In PHP, it's made much simpler.

<div id="content">
<?php
$hello_world = "Hello World";
echo $hello_world;
?>
</div>
floatingDivs 21 Junior Poster

Would you be up for using jQuery to allow for showing/hiding the content? If so, you could literally create the effect in two lines worth....

floatingDivs 21 Junior Poster

Sigh, read http://learncpp.com

If you don't like learcpp, tale a look at http://www.cplusplus.com/doc/tutorial/

There is NO reason for you to be unable to do such a program on your own with enough learning. This sounds jackass-y, but it's NOT intended to. Just trust me, put the time in and you'll be rewarded big time.

jonsca commented: Not so jackassy! +7
floatingDivs 21 Junior Poster

Care to post your entire HTML/CSS code? I despise having to guess the issue.

floatingDivs 21 Junior Poster

Typically, when I'm selecting the classes, I go from all the way out (UL) to all the way in (A). Take a look at the HTML structure below.

<ul class="navigation">
   <li>
      <a href="http://daniweb.com">Daniweb</a>
   </li>
</ul>

So, if I'm wanting to give the <ul> a background, I do this.

ul.navigation {
   background: #111111;
}

If I want to give each <li> a width of 50 px, I do this.

ul.navigation li { 
   width: 50px; 
}

Notice how I include my <ul> class when styling the <li>? That way, I make sure it only styles THAT <ul> structure. For instance, if you're importing ANOTHER external unordered list (UL), it may have just a <ul> structure with no class or id. Well, if my styling is "ul" instead of "ul.navigation", I'm styling both! That's not what I want...thus, always select the outermost tag when styling any single "component" of the page.

floatingDivs 21 Junior Poster

Try this. You weren't selecting your classes properly. For instance, your <a> tag has the class "nav" while the <ul> tag has the class "navbar". Yet, you used ".nav li" trying to select your <li> tags. However, all that was doing was selecting the <li> tags inside your <a> tags, which there are none of!

.navbar { margin-top:50px;
         text-decoration:none;}
.navbar li{padding: 5px 10px 5px 10px;
      margin-left:10px; 
      display:block;
      float:left;
      list-style-type:none;   
}
.navbar .navpic{border-style:solid;
        border-color:red;
        
        }

.navbar a.link{ color:#ffffff;
             border-color:green;
       }
.navbar a.visited { color:red;
         border: 3px solid yellow;  }
.navbar a.hover{background-color: blue;
      }
floatingDivs 21 Junior Poster

To center your footer, set .inner-footer margin to auto;

.inner-footer {
margin: auto;
}

Also, remove the overflow on your header, because I get a little scroll bar if my window is too small...come on, man! :P

floatingDivs 21 Junior Poster

andrewliu,

Also, the double quotes are typically used for HTML and single quotes used for PHP when echoing (thus avoiding the hard-to-read backslash double-quote escape).

As for Firefox having problems, have you tried clearing your cache? Or maybe its IE than needs the cache clearing?

floatingDivs 21 Junior Poster

Hi lochnessmonster,

Have you considered the tutorials @ http://www.learncpp.com/

I've been using it for rehashing my knowledge on OOP and it's been amazing. I've got a $100 book sitting right on my desk a foot from me, but the author on that site has made everything so easy to understand that I'm pissed at having had to spend so much money for my C++ class. *sigh*

Also, another good (albeit much less detailed) site is cplusplus.com/docs/tutorials

However, I'd REALLY recommend LearnCPP simply because it's working (for me).