Click here to Skip to main content
15,851,319 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: javascript alert() not showing Pin
Dave Kreskowiak3-Dec-23 10:07
mveDave Kreskowiak3-Dec-23 10:07 
QuestionInserting HTML from a fetch gives me extra blank rows..? Pin
William Morris 202124-Oct-23 19:58
William Morris 202124-Oct-23 19:58 
AnswerRe: Inserting HTML from a fetch gives me extra blank rows..? Pin
enhzflep28-Oct-23 0:00
enhzflep28-Oct-23 0:00 
AnswerRe: Inserting HTML from a fetch gives me extra blank rows..? Pin
Richard Deeming30-Oct-23 0:16
mveRichard Deeming30-Oct-23 0:16 
GeneralRe: Inserting HTML from a fetch gives me extra blank rows..? Pin
Richard MacCutchan30-Oct-23 1:53
mveRichard MacCutchan30-Oct-23 1:53 
QuestionInserting HTML from a fetch gives me extra blank rows..? Pin
William Morris 202124-Oct-23 9:31
William Morris 202124-Oct-23 9:31 
QuestionMoving a <div> from right edge of screen to left slowly? Pin
Blake McKenna27-Sep-23 18:51
Blake McKenna27-Sep-23 18:51 
AnswerRe: Moving a <div> from right edge of screen to left slowly? Pin
Steve Raw21-Oct-23 18:39
professionalSteve Raw21-Oct-23 18:39 
Sometimes I use JavaScript to animate elements, and other times I use CSS to assign the object with animation parameters. Using CSS to animate an element is extremely simple. You specify the CSS property that you want to animate. For example, if I wanted to animate an element from point A, to point B on the screen, I would set the element's CSS parameters to animate any change in the element's top/left CSS value. From there, it's only a matter of setting the element's top or left position to a different value, and the animation occurs entirely on its own. Make sure that the div element you want to move has its position property set to "absolute", otherwise, the element will not be able to change its location on the screen. I'll include some JavaScript code that I've written which will provide you with an example.

//Set the default CSS animation properties to an object using a predetermined set of values. 
//This function is created to add CSS animations to objects quickly and easily, without having
//to set the parameters. 
function default_config_elem_for_animation(elem_id) {
    var element = null;
    var animations_on = null;

    //alert(elem_id);

    animations_on = global_animations_on; //see if there are animations implemented by referencing a global variable. See globals.js

    if (animations_on === true) {
    element = document.getElementById(elem_id);
        if (element !== null) {
            element.style.transitionProperty = "left, top, width, height, box-shadow"; //if any of these CSS properties of an object changes, they will animate.
            element.style.transitionDuration = "0.3" + "s"; //set the time in seconds
            element.style.transitionDelay = "0.007" + "s"; //set the delay before starting the animation
            element.style.transitionTimingFunction = "cubic-bezier(0, .55, .45, 1)"; //designate a curve by which the nature of the animation occurs
        }
    }
}

QuestionJasmine - monitor all calls of a method? Pin
NoMoreStackOverflow22-Sep-23 1:25
NoMoreStackOverflow22-Sep-23 1:25 
AnswerRe: Jasmine - monitor all calls of a method? Pin
jschell23-Sep-23 15:25
jschell23-Sep-23 15:25 
GeneralRe: Jasmine - monitor all calls of a method? Pin
NoMoreStackOverflow23-Sep-23 21:33
NoMoreStackOverflow23-Sep-23 21:33 
AnswerRe: Jasmine - monitor all calls of a method? Pin
jschell25-Sep-23 9:10
jschell25-Sep-23 9:10 
GeneralRe: Jasmine - monitor all calls of a method? Pin
NoMoreStackOverflow25-Sep-23 16:29
NoMoreStackOverflow25-Sep-23 16:29 
QuestionMutation Observer, editing a value Pin
jkirkerx15-Aug-23 12:49
professionaljkirkerx15-Aug-23 12:49 
AnswerRe: Mutation Observer, editing a value Pin
jkirkerx15-Aug-23 13:07
professionaljkirkerx15-Aug-23 13:07 
GeneralRe: Mutation Observer, editing a value Pin
Richard Deeming15-Aug-23 22:36
mveRichard Deeming15-Aug-23 22:36 
GeneralRe: Mutation Observer, editing a value Pin
jkirkerx16-Aug-23 7:33
professionaljkirkerx16-Aug-23 7:33 
AnswerRe: C++ Issue: Forgotten Virtual Destructor - Need Help Resolving! Pin
Richard MacCutchan15-May-23 2:53
mveRichard MacCutchan15-May-23 2:53 
GeneralRe: C++ Issue: Forgotten Virtual Destructor - Need Help Resolving! Pin
Richard Deeming15-May-23 6:25
mveRichard Deeming15-May-23 6:25 
Question[Learning/Beginner] Confused about await, async and fetch. Pin
Maximilien2-May-23 4:09
Maximilien2-May-23 4:09 
AnswerRe: [Learning/Beginner] Confused about await, async and fetch. Pin
Jeremy Falcon2-May-23 6:07
professionalJeremy Falcon2-May-23 6:07 
GeneralRe: [Learning/Beginner] Confused about await, async and fetch. Pin
Maximilien2-May-23 11:27
Maximilien2-May-23 11:27 
AnswerRe: [Learning/Beginner] Confused about await, async and fetch. Pin
Richard Deeming2-May-23 23:33
mveRichard Deeming2-May-23 23:33 
GeneralRe: [Learning/Beginner] Confused about await, async and fetch. Pin
Maximilien3-May-23 3:41
Maximilien3-May-23 3:41 
GeneralRe: [Learning/Beginner] Confused about await, async and fetch. Pin
Jeremy Falcon3-May-23 11:13
professionalJeremy Falcon3-May-23 11:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.