Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I've created an eBay listing and it work's correctly on eBay.
But I have an issue. The listing's are listed via 3rd party software and that software has their own JS for changing the images. And it doesn't work with my scripts. I use jQuery.
Can anyone advice a simple method to swap the image src on click event?
For example: Leave as it is, but overwrite the JS. Now it is set up to listen for mouse hover. Can I write a new script so when clicked it would swap the images?
Here is the link to the listing: Listing template here
To change src attribute of an image :
$('#myImage').click(function(){
$(this).attr('src', 'myNewImage.jpg');
});
To stop listening to the mouseover event :
$('#myTargetWhichHasAnEventAttached').off('mouseover');
Edit to answer the comment :
$('.image_small_js').off('mouseover'); // supposed that the mouseover event is attached on .image_small_js
$('.image_small_js').click(function(){
$('#bigpicture').attr('src', $(this).attr('src')).hide().show(); // .hide().show() makes the change effect more smoothy... can be used with timers
});
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I shouldnt even be in HTML/CSS, but here I am trying to incorporate a php modal contact form into my site...
I'm trying to get all of a demo form's functionality into my footer page (and then I'll restyle everything.)
http://danux.me/sections/footer_modal.html
I'm trying to get "email me" to fire ideally, but am settling now for just the Demo button to fire the popup form.
I also uploaded the demo form I'm pulling code from, just to make sure it works on my site. (It does.)
http://danux.me/contact/
Any guesses as to what I'm doing wrong?
Your first link is in a different folder, yet the url for $.get points to the same relative file. Which isn't there.
So in contact.js needs to have
$.get("../contact/data/contact.php", function(data){
I obviously cant test this. And it looks like there is some redesign in folderstructure coming up.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm testing some javascript on jsfiddle and for some reason I can't get a function to fire on a button click. Any advice?
jsfiddle link
In the Frameworks & Extensions panel, set onLoad to No wrap - in <body>.
It took me a while to figure this out.
You have configured JSFiddle to wrap the code in an onload event handler. Consequently the function you are trying to call onclick is out of scope.
Don't use intrinsic event attributes. Use jQuery's (since you are using jQuery already) event binding instead.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So I've seen a mouse-hover effect on 2 websites so far and I really like it.
This is the effect I'm talking about.
I'd be grateful if somebody can tell me how to get that effect on my webpage.
It only appears under your cursor when you hover over the page.
The site you have linked in the comments uses the HTML canvas element. But You can simply use already existing libraries for that effect.
Examples mentioned in the comments:
http://jnicol.github.io/particleground/
http://github.com/VincentGarreau/particles.js
Simply, Go to the webpage you wanted to Copy it's effects or anything from it
Right click, View page source
If the effect is made by Css, you will find it in stylesheets tab
If it's using jQuery/Js, Search the head for <script> , Read them and copy the effect (assuming that you understand js/jquery
For more simplicity, use Firebug, open it and just point the cursor at the item you want to see it's source.
But, actually
You can find it at github Here
Change what you want.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I add my TRIGGER DIV A over $(".DIVB").html(data); from a AJAx Responsebut when i now want to trigger some code over the $(".TRIGGER DIV A").click(function() it isnt working. Can someone explain me why ? And is there a Way to fix this or is there a working arround ?
It looks like you're using jQuery's .click(). If HTML is added dynamically to the DOM, you need to bind the click event to the element after it has been added. Otherwise, when $(".TRIGGER DIV A").click(handler) runs and jQuery looks for the element to bind, it isn't able to find it.
You may consider using .delegate() instead. This ensures that the event is bound to all elements relevant to the given selector regardless of when it is added to the DOM. You can find the documentation for usage here: http://api.jquery.com/delegate/
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I'm trying to change or remove errors from a HTML page I'm using firebug add in firefox and I have this part which I really don't where its writen :
is there a way to get the file where this is write .
thanks for any hint
Continuing from my comment: The highlighted element is dynamically added by a slider plugin e.g. like http://jqueryui.com/slider/ The clue is the classes like ui-slider-handler.
Look for the id="voltage" to find the place in the HTML where the div is and look for #voltage or ("voltage" or 'voltage') to see where the plugin is connect to it (in any jQuery or Javascript code).
I don't think you can get the exact path of the file, but check "View page source" option to see what files the page has been linked to.