astralaaron

Members
  • Content count

    1,251
  • Joined

  • Last visited

  • Days Won

    1

astralaaron last won the day on July 1 2012

astralaaron had the most liked content!

Community Reputation

17 Good

About astralaaron

  • Rank
    Dedicated Member
  • Birthday 05/01/1985

Previous Fields

  • Languages
    PHP JavaScript

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Gender

Recent Profile Visitors

13,544 profile views
  1. I would look into jquery's closest() function which will search up the dom until it finds what it is looking for. Once you found the tr I think you could use jquery's index() index function closest() https://api.jquery.com/closest/ index() https://api.jquery.com/index/
  2. I think this may be a (hopefully temporary) issue with Firefox and aria-live as I can see there are pages written about aria-live with examples on the Mozilla Developer website: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions The example's don't have role="alert". I recently noticed a popup alert when opening firefox while running JAWS which mentions that "some accessibility features are disabled due to conflicts with new firefox features". So I guess all there is to do at this point is hope they fix this. Chat areas using aria-live as it is right now would be terrible with it announcing "ALERT!" before each new message.
  3. Is there any way to make aria-live="assertive" work on firefox without having to use role="alert"? By the way this is using firefox on windows with JAWS. aria-live with mac on firefox doesn't work. In the jsfiddle example link below, the live element has role="alert" and it works but if you remove the role="alert" it won't work. The reason I want to get this working without the role="alert" is because JAWS announces "Alert" before each message which when the role is set to alert. https://jsfiddle.net/st5vnsd9/16/ Thank you everyone
  4. If anyone else has an issue like this, I seem to have fixed this by adding a small delay with a setTimeout
  5. I am having an issue where when I have a rich text field that has design mode on that is within a sortable LI. The problem is that designMode changes to 'Off' if the LI is dragged to a new position. And even though I am able to target the correct iframe, it seems to ignore when I tell it to turn designMode back on, does anyone know why this is happening? Thank you for reading. i set up a small jfiddle example demonstrating this.. the two iframes have designMode on but when you re-sort them, the one that you clicked to move to a new position gets it's designMode turned off, and my attempt to turn it back on fails https://jsfiddle.net/LcLfaa8j/2/ I am using FireFox currently
  6. Is there a way to do this in jquery?: There are hidden elements on my page, and they show up once a button is pressed. I need for the mouse over / hover to be activated for an element if the mouse is sitting over the top of it when that button is pressed. Before the button is pressed, the element has display:none (must be like that so elements underneath can be accessed by the mouse, and pointer-events is not an option because of browser compatibility requirements). Then the button is pressed, display:none goes away and the element appears. However, hover event doesn't fire off until the mouse moves if the mouse is already sitting on an element. Any suggestions? Thank you
  7. I was able to fix this by creating a function with the jquery inside it, passed the i/x parameters in to that function and it works.
  8. Hello, I'm having a bit of trouble with jquery. I have something similar to the following: function someFunction( i ){ for(var x = 0; x < numOfPosts; x++) { var callbackA = function() { console.log('set i=' + i + ' x=' + x); }; var callbackB = function() { console.log('set i=' + i + ' x=' + x); }; $( element ).hover( callbackA , callbackB ); } } The issue I am having is that x is always equal to the "numOfPosts" for each iteration. Anything obvious that I am doing incorrectly? Thanks everyone for reading.
  9. These tutorials are great, thanks for posting them. Please post two more tutorials: 1) Path Finding. Please show how you would handle controling a game piece with the mouse, where you would need to click the mouse some where for the game piece to move. Then it would need to find the correct path to move around any objects. This would be awesome! 2) How would you handle game states? as in "menu screen, level 1, level 2, end screen" etc. thanks again!
  10. I have a really hard time understanding how to write regular expressions..even when looking at examples. I am trying to match a (word)(3-4 digit number)(anotherword) for example "firstname4343lastname". I need to make sure it is in that format. I've been trying many different things, but here is the most recent: http://jsfiddle.net/6ajj95af/ Any help is appreciated. Also, I will need to extract the number after confirming the format, any advice as to the best / most efficient way to do that would also be a really big help right now. Thank you everyone EDIT: The JSFiddle is sort of a bad example, just to clarify: The "firstname" and "lastname" are actually meant to be fixed words... it is something like worda2738wordb the number is variable.
  11. I am working on giving this example a try right now, but I have a question now about how to structure my script. I didn't realize putting objects inside of functions was really bad for garbage collection. Since I had read that Javascript can be used like an OOP language, I've been writing all of my scripts like that because it helps me organize and work with them. For example: I am always writing scripts like this because they end up getting big and I find that I can stay organized and have scope to everything easily: function SomeScript() { var s = this; this.animate = { 'vars': { 'x' : 0, 'y' : 0, //etc.. }, 'start' : function() { console.log('starting x/y = ' + s.animate.vars.x + '/' + s.animate.vars.y); s.animate.stop(); }, 'stop': function() { console.log('stopping'); } };}var x = new SomeScript();x.animate.start(); Would you recommend I ditch the above style and try to write things like this?: var x = 0;var y = 0;function stop() { console.log('stopping');}function start() { console.log('starting x/y = ' + x + '/' + y); stop();}start();
  12. I had no idea a timestamp was automatically passed in! This does seem to improve the performance slightly..however, now in the start function the frame rate doesn't calculate properly and I am not quite sure what the math needs to be to fix it. I am referring to this line in the 'start' function: e.animate.frame.rate = 1000 / e.animate.frame.fps; Changing that 1000 down to 100 or so makes it pretty smooth..I read that the requestAnimationFrame timestamp is equal to 10 miliseconds. I'm interested to see it when the frame rate is calculated properly, but it does seem to still have an occasional stutter. I do think you are right about the garbage collector, after reading around I am pretty sure on my main script that is having this problem I did a poor job of it. I have a couple questions about that.. first, if I have a function like the following, do I need to set the variables to null after using them?: function a() {var x = 'something';var y = 'something else';var z = x + " " + y;} Also, if I have a function that is a member of another function like the following, and I only use it once, should I be deleting it? (delete b.C) function B() {var b = this;this.C = function() {}} EDIT/question: Another indication (i think) that it is poor garbage collection is that if I add multiple instances of this my canvas/script, they all stutter at the same exact times, and for the same duration. It seems that javascript entirely locks up. Would you say that is an indication that it has nothing to do with my animation loop in the first place?
  13. If you view the jFiddle example in chrome, and view the Javascript console, you will see the frame rate output is constant and smooth. Then if you switch over to Firefox > Firebug console and run the jFiddle again, you will see it goes smooth except for every so often it pauses for a moment. I've literally been unsuccessful for over a year to get a smooth loop going in all browsers. I'm hoping someone can shed some light on whats going on with this small example! I appreciate everyone who reads this and takes a look a the problem..: http://jsfiddle.net/aLv3vsv8/
  14. Ignolme I really appreciate you responding. I'm sorry for such a late response, when I returned home from work, my computer monitor wouldn't turn on. Your example makes sense, I will play around with it soon and let you know how it went!
  15. I was wondering how to write a structure like jquery does for example so that you can select an element like: somescript('some_element').someMethod(); etc...how do you chain together basically??? thank you the first function would just return the element..then whatever function you did after would run on that element