-
Content Count
3,324 -
Joined
-
Last visited
Everything posted by truefusion
-
Let's look at it step by step. We'll start at where it gets activated: <div onmouseover="fade(this);" onmouseout="return false;"> <img src="" alt="TEST"/> </div> As the attribute suggests, fade() gets called when the mouse (or cursor) hovers over the element. You'll notice the pointer or variable called "this" being passed in the parameters. This variable points to the position in the DOM of the element of the attribute, in this case being that DIV. We pass it in to the fade() function to make our job easier. To also make our job easier, we declare a global variable called "img": var img;Note that in JavaScript you don't necessarily need to end the line with a semicolon, i merely do it for good practice in case i code in other languages that require such a thing. This global variable we use to store the reference to the image that we want to fade. Since it is a global variable, we are therefore capable of changing its value within functions. Going back to onmouseover, the function fade() gets called. In order to be able to use the reference "this" within the function, we have to specify a name for the variable that will carry the same value, in this case being "id." This allows us to track down the image element easier that we want to fade in. We then call a method that traverses the DOM starting at the DIV element that the variable id is pointing to, to find any child image elements. This method is getElementsByTagName. Since we expect the image to be the first image it finds, that is, due to the way we coded the HTML layout, we append the index 0, since getElementsByTagName returns an array. From there we state a for loop to make the fade effect appear to be occurring within one second—that is, if you do the math. The setTimeout function takes two parameters: the first is the function you want to call when the time in milliseconds from the second parameter is reached. Since the for loop happens rather quickly, the for will finish before all the setTimeouts return. The function we want to call is setOpacity(), and setOpacity() takes one parameter, which we have the for increment the value that we pass to obtain a fade in effect. The setOpacity() function is made to support standard and non-standard (i.e. Internet Explorer) browsers. Since the value of opacity has to be a double or float (what-have-you) for standard-compliant browsers, we divide the value. For Internet Explorer we require a whole number from 1 to 100, so we multiply it by ten so that it'll fade within one second evenly. Since during testing of the script, moving the mouse out of the DIV element caused the fade in to occur again, we return false on mouseout to prevent it from having the same effect occur twice. And that should pretty much explain the entire process.
-
Luckily in your case you have made it easy to work with. If i'm not mistaken, there's really no way to fade a background image without it affecting the elements and text within the element holding the background image. But since the text is above the image, that means you can have the image you want to fade in upon hover under the text without also fading the text. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; <html xmlns="http://www.w3.org/1999/xhtml/ ; xml:lang="en" lang="en"> <head> <title>untitled</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <script type="text/javascript"> <!-- var img; function fade(id) { img = id.getElementsByTagName('img')[0]; for (var i = 0; i < 11; i++) setTimeout('setOpacity('+i+')',100*i); return false; } function setOpacity(value) { img.style.opacity = value/10; img.style.filter = 'alpha(opacity=' + value*10 + ')'; } // --> </script> </head> <body> <div onmouseover="fade(this);" onmouseout="return false;"> <img src="" alt="TEST"/> </div> </body> </html> You can work off of this if you want.
-
JavaScript may be unnecessary for this. Try the following and see if it gives you the desired results: Make an animated GIF that fades from blue to red but make sure it does not loop (unless perhaps you want a pulsating effect). Then upon hover, change the background image to the GIF. I am uncertain on whether or not the GIF will restart its animation upon hover, but see if it does.
-
Advantages Of A 64-bit Operating System And Software?
truefusion replied to rayzoredge's topic in Operating Systems
I've never had this problem. I don't even know if one can even "design" for 64-bit. All the C++ programs i've made compiled fine for either without any change in code, and i've never noticed any decrease in performance. If i'm not mistaken, all you need to do to make a program "64-bit" is to compile it on a 64-bit system. For heavy processing, you may notice that a 64-bit system would perform better for such tasks. By "heavy processing," i mean things like scientific calculations and video production. NASA would (or should) benefit from 64-bit—though it may cost them a lot of money to replace parts. -
As some of you might know, i have started making my own desktop environment for systems that use the X window system (a.k.a X11, X.org)—meaning you would even be able to use it under the Mac OS. Obtaining documentation for making your own desktop environment for X, however, especially with the toolkit of your choice, isn't easy, at least not without browsing through source code of already available desktop environments out there. Being the kind of person who prefers to skim through documentation as far as it will allow him to get the job done or started or have something working as quick as possible, i couldn't dive into, for example, KDE's source code and expect to come out of it knowing how to make my own environment so quickly. Luckily i came across simpler desktop environments that use the toolkit i wanted to use—Qt4. For the sake of making things easier for others who would like to make their own desktop environment, or window manager, i write this out. The basics are quite simple, though. For my current purpose i don't need to make a display manager for loading my desktop environment—thankfully; i can use GDM or KDM, et cetera. What a display manager basically does is it runs a program specified within a desktop file (which can be located in a few locations, but i place the desktop file at /usr/share/xsessions). The program it runs, in turn, runs any other program it needs to form a complete desktop environment—that is, along side any system programs. These programs are known as "clients." The clients communicate with the X server; this is known as a client-server relationship. Naturally, your program does not initially have that relationship, so you have to tell the X server to redirect the event signals to your program. X event signals inform your program about what is going on with the X server—that is, based on the signals you chose to be directed to your program. X is written in C, therefore using pass-by-reference. To select which events you want your program to be informed of, you use the XSelectInput function. For window creation, the important event mask is SubstructureRedirectMask. You want your program to pay attention to the event type MapRequest. From MapRequest you're going to want the member window from the struct. This member holds the window ID which is key for any window management, because you're going to need the window ID in order to reparent the window with the XReparentWindow function. This function allows you to make a GUI widget the parent of that window. I chose a GUI toolkit for my desktop environment to tremendously ease the process of designing my own desktop environment. The GUI toolkit does all the drawing for me, including the text. Indeed, the X window system, though providing the functions to draw on the screen, does not provide the conveniences that a toolkit does. If i were to use the X window system alone for my desktop environment, in order to draw text, for example, i would have to draw it line by line. I chose the Qt GUI library because i find it to be the best and most convenient one. I use the x11EventFilter method to pay attention to what events the X server is informing my program about. Meaning if you want to make your own desktop environment using the Qt GUI library, you need to subclass QApplication. Currently my desktop environment takes up about 3 megabytes without a wallpaper; with the common default_blue.jpg wallpaper, it takes up about 15 megabytes. Working with windows, that is, clients, and managing them is a bit annoying. For example, whenever you resize the window (i.e. the parent widget of the client), the client program doesn't resize with it. Consider the window as a viewport with an invisible scrollarea. To put it more simply, that is, in HTML and CSS terms: let's say you have a DIV element whose ID is "parent" with another DIV element within it whose ID is "client": <div id="window"> <div id="client"></div> </div> Also assume that the following CSS code is applied to these elements: #parent {overflow: hidden;width: 500px;height: 500px;border: 2px solid black;}#client {height: 700px;width: 700px;}Anyone who knows HTML and CSS should already know how this looks like. Well, this is what i was talking about. Whenever you resize the parent element, you also have to resize the client element while considering the borders and any padding in order to make things look perfect. You can specify the top and left coordinates of your client within your widget using XReparentWindow. However, that is merely like having "padding: 3px 0 0 3px;" for the parent element up there. Therefore in order to achieve the desired appearance, you use either XResizeWindow or XMoveResizeWindow functions. Of course, unlike HTML, you do not know the ID of the window, therefore you have to figure out a way to keep track of all the window IDs—but that is not as hard as it sounds. Anyway, that is all for now.
-
Introducing Opera! The Fastest Web Browser On Earth! as they say..
truefusion replied to braitt's topic in The Internet
Opera already knows about the G-mail problems, you could see it in their change logs (though i've never experienced any problem with Opera and G-mail). If i'm not mistaken, most (or a lot) of the fixes for G-mail are found within the browser.js file in the Opera profile on your computer. I'm currently running build 4268 of Opera 10, and checking my G-mail runs well (though i don't use the chat feature—i disable it, it's a waste of loading time for me; i use Pidgin for Gtalk anyway). Although G-mail itself is still in beta (unless their logo hasn't updated to reflect the actual changes), assuming Google has all the AJAX working properly for G-mail, then it's probably how Opera interprets G-mail. -
Actually, the Bible doesn't allow for making images for one to praise and worship or pray to. (Exodus 20:4) If we evoke his name, it is not (or should not be) to evoke an image. Given the context, if the adornment is directed to humans or an object, then they do nothing (beneficial) for you. In that case, that would be because they are ignorant of what you are doing. But omniscient beings aren't ignorant.
-
Introducing Opera! The Fastest Web Browser On Earth! as they say..
truefusion replied to braitt's topic in The Internet
Have you checked the right-click menu, that is, "Validate"? Also, look up DragonFly. I've used DragonFly and it is a very good web developer tool—i can edit almost anything on the page i choose, whether it be text, CSS, or whatever else. The only thing about it, though, is that it appears to not be built into the browser itself but, rather, is queried through the browser after opening it up. However, i haven't tried opening DragonFly without being connected to the internet, so perhaps it works offline as well. This will be introduced in version 10 of Opera for what appears to be every operating system that Opera supports. -
How Did They Live So Long? What if they didnt?
truefusion replied to room2593's topic in Science and Technology
I have found it interesting looking at the times before the Law was decreed, watching people already doing what was okay for them to do, in the Law. But i say clean and unclean because that is what is written in Gen 7:2. If i'm not mistaken, "clean animals" is defined implicitly in the Bible: that is, the unclean animals are defined, and whatever is left over is considered clean. Of course, there were some explicit exceptions, that is, concerning certain bugs (and probably others), but marking things as clean and unclean wouldn't change anything. There's no such thing as "unclean sheep," for example. Anything declared as clean will be clean until declared unclean—which you may find never occurs. You might find the term "with blemish," but that doesn't mean "unclean." -
Introducing Opera! The Fastest Web Browser On Earth! as they say..
truefusion replied to braitt's topic in The Internet
Did any of those tabs have a page with some form of plug-in running (e.g. flash)? Were you visiting a Microsoft website? I realize that you may find it odd that visiting a Microsoft website would actually cause Opera to act funny, but it happens to me on my Linux system. Whenever it happens i find it to be very ironic, that is, being on a Linux system. It's interesting, though, that you had problems using G-mail in Opera 10, since for me it works better than it did when i was using the latest stable version of Opera. Perhaps the problem is specific to only the Windows version of Opera (assuming you're using the Windows version of Opera)? -
Broadcom Wireless Card Incompatible With Linux?
truefusion replied to brandonjbegle's topic in Operating Systems
Broadcom is known to be troublesome concerning Linux; it's the only one i've heard that doesn't play well with Linux. I'm not sure if a success story exists concerning Linux and Broadcom, but if you haven't done so already, using perhaps a wired connection, visit their website and look for any drivers and, of course, documentation—you're bound to really need the documentation (if requiring to compile from source). If they don't have any, that would explain a lot, but also do complain to them about it. -
The way you set up the program doesn't allow it to loop. You never clear the hline variable, therefore holding the value throughout the script, therefore passing by the while loops and the if statements. Assuming the following is what you want, this is the correct way of doing it: #!/usr/bin/env pythonimport syshelp="""1. What is this?2. How does this work?3. What did you make this in?4. Back5. Quit"""print helpwhile True: hline = raw_input("Please select a number between 1 and five: ") if hline == '1': print("This is a program duh") elif hline == '2': print("Through programming :-p") elif hline == '3': print("Python") elif hline == '4': import index.py elif hline == '5': sys.exit()
-
Logo Design Create a logo in the right way.
truefusion replied to andreip's topic in General Discussion
Where'd you get the nice background pattern? I could use a pattern like that. -
Fedora is known for not activating programs for you, or at least back when i used it i would always have to start Apache myself, so i would assume the same for something like Postfix. During the installation its configuration script should have activated; if it didn't, then you'll have to figure out how to run that script. But if you did configure it, then it could be that it's not running in the background or that you configured it (unknowingly) to be limited only to your network and not extending to the internet. I'm not sure how Fedora handles programs like Postfix, so you'll have to do research on that.
-
Complex Php Script. I need a script for my site...
truefusion replied to Baniboy's topic in Programming
Here's something simple that should do what you want: <?phpforeach (glob("*.txt") as $filename) { $arr = array_reverse(array_slice(file($filename), 0, 4)); foreach ($arr as $value){ echo '<font color="red">'. $value .'</font><br/>'; } echo "<hr/>";}?> Do note i haven't tested this and just wrote it here on the fly, but i don't think there are any errors in it. Also note that depending on the file size of the files and the amount of files it has to go through, this program could use a lot of memory and take a while to load. -
I don't use the Wine that's in the Ubuntu repository, i always compile the latest development version. I think the version of Wine i was using when i last used iTunes was probably 1.1.13 with, i think, iTunes 7.2. I think iTunes 8 was the version that has been known to work not so well with Wine, but version 7 always worked for me, that is, back when i used iTunes. Go here and pick the version you have and see if they offer any installation guides.
-
You mean the icons? If so, then yeah, they'll be implemented whenever i get to that part of the development and figure out how to obtain the icons. I would have to figure out, though, how to maintain performance when updating the menus, since they don't really update themselves. I figured perhaps another XML file would help.
-
I'm in the process of designing my own desktop environment for systems capable of running the X window system, and i got to thinking just what would be the best possible way to design the start menu. I'm not entirely sure of the practicality of this concept; however, to me it appears to be better than whatever is currently out there—but you decide. The concept is similar to the simple pop-up menus that you see today but considers more of a toolbox way of displaying the program shortcuts. I didn't want it to take up space in the panel itself like today's start menus generally do. That involves placing it on top of the panel, but, due to this concept, attempting to take up as little space as possible. Here's a current mock-up of the panel (it'll be shorter in the actual desktop environment): Here's the start menu in action (couldn't get it at a higher quality): If you have any ideas for improvement, suggest them here.
-
Introducing Opera! The Fastest Web Browser On Earth! as they say..
truefusion replied to braitt's topic in The Internet
Have you noticed the MDI yet? Tab browsing isn't the same in Opera as it is in other browsers. Other browsers normally use tab widgets for their tab manager—this makes visible only one page per window. Opera uses an MDI area. What does this mean? Resizable views; that is, you can view several pages at the same time. I know konqueror allows for split views, but that's different. With an MDI area you can tile and cascade windows—accessible from the Window menu. Of course, if you have more than 4 tabs opened, tiling them is not all that useful then. -
Free Stanford Lessons On Programing
truefusion replied to random truth's topic in General Discussion
I've made a similar topic about this, but you can find other Computer Science videos in their Youtube playlists. And not just from them, but also from Berkeley, MIT, et al. -
Mycents To Xisto Dollars Not changing to xisto dollars
truefusion replied to aloKNsh's topic in Web Hosting Support
A conversion can take up to 24 hours—that is, as long as it needs to—before an actual conversion takes place. The script apparantly prioritizes the process of conversion in order to reduce the work load. It will eventually convert your myCENTs into Xisto dollars. P.S. Cut down on the excessive periods. -
How Did They Live So Long? What if they didnt?
truefusion replied to room2593's topic in Science and Technology
She was declared as a young person at the time of the banquet and a little further on, but i have no idea what age range was considered young. But the text makes clear that Esther, by the time she requested to have her people saved, she would have been in at least above 20 years old, that is, assuming she was picked within her teens, since the time of the banquet was in the third year of the king's reign, and it had passed over 9 years before she requested for the king to put an end to Haman's plans. But i didn't see any command from God (albeit i did skim a bit) for her to do such things. Hmm. Though i've heard about it, i didn't know it was called "Pangea." But the Pangea concept does make things interesting. I had thought about this too in the past, but never considered bare land—that is, land without mountains high enough to reach levels with dense air. I have no reason to not allow for this, but running off of the thought, would it be safe to assume, then, that the actual shape or land mass was entirely the same as today but placed together like a puzzle? This does bring in a lot of scientific explanations or considerations. Genesis 1:9 could probably be interpreted to argue for a Pangean earth. But in either case, i can accept the majority of this, if not the whole thing, while maintaining my position. Interestingly enough, your questions should have answered themselves. Concerning the assumed lions, Noah had to bring them in because God commanded Noah to do so. Even though those animals were "just fine," God had declared their annihilation anyway due to how wicked the people were. (Note: this implies that animals were made for us, and if there were no us, then animals serve little to no purpose.) I would find it more probable (which implies more logical) if God brought the animals to Noah rather than have Noah go all around the world picking 16 animals (i.e. 7 pairs of clean animals and one pair of unclean animals, totaling 16) of every kind of animal just to place in his boat, the Ark. Noah at the time was over 500 years old when God declared the people as wicked (because Noah's sons weren't born till after Noah turned 500: Gen 5:32), therefore allowing less than, and no more than, 100 years for Noah to go and retrieve the animals. Even if we were to accept the Pangea concept and even if we were to accept that Adam's time and Noah's time were not that far apart (therefore implying less animals existing back then than today's world), there is still less than 100 years for Noah to build an Ark capable of holding so many animals. There cannot be enough time for Noah to build an Ark and go around the world picking 16 animals of each kind before he turns 600 years old. Therefore God must have brought these animals to Noah, therefore only requiring a regional flood. Right; i've heard a lot about this. They say this still exists among certain African tribes today. I'm not entirely certain about how the Jews did it back then, but i hear that priests weren't allowed to become priests unless they remembered everything they were told to remember, where this would often involve a book's worth of information (normally, i would assume, being the Law, that is, the Books of Moses). I'm not entirely sure on the accuracy of this statement, but the Bible mentions plenty of times that the Jews and surrounding nations kept a lot of annals concerning what happened in their time. Some of which, if you recall, for example, in the book of Joshua (Joshua 10:13—i.e. the book of Jasher), bearing more authority, at least through implication (i.e. due to their mentioning), than certain books of the Bible itself. Only martyrs who lost their lives for Jesus and God's word will be part of the first resurrection (Rev 20:4-6). After the thousand years, then everyone will be awakened and called to judgement. Unless you become a martyr from here to then, it appears you're not going to be able to witness what you want to witness (not that it can't be replayed for you later on, but if what God has in store for those written in the Book of Life is better than any amazing previous event, then chances are you will not care to have it replayed). Whether or not the fire is metaphoric or not, i do not know, but i've always considered them literal—doesn't really matter to me if they weren't. Oh, i've seen the Youtube comments. I debate on there, too. I've been the "victim" of much name calling, though it never helps their arguments. -
iTunes normally works "out-of-the-box" with Wine. The only known problem, which the Wine Application Database provides a solution for, is that when you first start iTunes, due to QuickTime, you'll notice the screen go black for a while. Refreshing the desktop and moving windows around and hovering over items "brings back" the desktop (although KDE4 auto-corrects itself). Also, burning to CD may not be supported in Wine.As a substitute, just switch to Amazon MP3 or some other source that doesn't force DRMs onto your music, then download Amarok 2 to play these non-DRMed files. This process of switching, however, you may find a bit hard to do, since mostly likely your parents have already purchased music from iTunes, therefore having them "tied" to iTunes insofar as they have the DRMed music files.
-
Is Osx/linux More Efficient With Hardware Than Windows?
truefusion replied to rayzoredge's topic in Operating Systems
Actually, there are two big reasons why you cannot run Mac OS X on a PC (i.e. non-Apple computer): (1) the Apple devs designed Mac OS to run on only Apple computers, therefore requiring some hacking and installing drivers in order for it to run on a PC. (2) The license applied to the Mac OS, if i'm not mistaken, explicitly says you are not allowed to install it on non-Apple computers, therefore would make it illegal to install it on a PC.