Javascript/jquery Images slideshow does not work - javascript

I am trying to create an easy slideshow but It is not that easy at all :(.
I have few problems to make it work.
Here is my code so far: http://jsfiddle.net/WUE9g/1/
PS: I would much appreciate any kind of help.
Thank you!

You had an unclosed function call in your code, check now: http://jsfiddle.net/WUE9g/3/
Use firebug, it has an error console that tells you what's going on.

I think that your parenthesis are not matching. Use
$(function() {
rotatePics(1);
});
instead of
$(function() {
rotatePics(1);
}
Since $ is a shortcut to the jQuery function, you need to use it like any other function (e.g. rotatePics()).

Related

$.alert is not a function in Jquery in console error

I'm executing an alert with Jquery as like $.alert(param); The console is providing as $.alert is not a function.
How to overcome it ?
function AlertModelPoupMast(param) {
$.alert(param); //It's custom alert. dont suggest normal alert() here please.
return false;
}
If I place $.noConflicts() it is working for first time , but after that again not working.
function AlertModelPoupMast(param) {
$.noConflict(); //working for 1 time. not working from 2nd time.
$.alert(param);
return false;
}
Replace
$.alert();
to
alert();
This can happen when you not included jquery file or $ is conflicted with some other plugin, changing $ with Jquery may solve that problem,
I think you are using craftpip custom alert like here
here you look with the issue
https://github.com/craftpip/jquery-confirm/issues/32
me also faced similar issue. And the issue was jquery.min.js loaded twice which caused conflict. Make sure jquery and all other js files loaded once. It may fix the problem. Also put jquery.min.js at the top of other js files if possible, because jquery plugin may be needed by other plugins.
Hope it'll help someone.
Use
alert("Your message");
Please ask for clarification if needed.

jQuery Datepicker okay on first load of a page but fails thereafter

This is the second time I have asked this question. Neither the responses I received initially nor any of the myriad of other answers to similar questions have helped me to solve the problem.
The problem is that once a datepicker object is initialized, a second initialization causes it to fail. I have tried all sorts of blurring and destroying but nothing has worked for me.
Please take a look at this simple page which demonstrates the problem
Here is the javascript for the page that contains the datepicker input elements...
$(document).ready (function(){
sp = " ";
lf = '\n'
$(function (){
$("input#datepicker").datepicker();
$("input#datepicker2").datepicker();
})
})// document ready
I would truly appreciate any help to get this working. I've already spent about eight hours with no success.
Thanks,
-dmd-
Your code is obsolete. you got a document ready function inside of an document ready function ( $(function(){}) is a shorthand of $(document).ready(function(){}). But this isn't the Problem. Use the following code in your divtest.html and remove the calls in datepicker.html:
$(function(){
$(document).on('DOMNodeInserted','input#datepicker,input#datepicker2', function(){
$(this).datepicker();
});
}
Finally, I have a solution and it is simple.
On the datepicker page, before initializing datepicker, add this line
$('#ui-datepicker-div').remove();
then
$("input#datepicker").datepicker();
$("input#datepicker2").datepicker();
This works for me and I truly hope it works for everyone else who has been bogged down with the issue.

JQuery plugin dotdotdot not working

I have this fiddle:
http://jsfiddle.net/6HKJZ/3/
This is the part of CSS that causes troubles:
.r .rp{
max-width:50%;
}
.r .r2{
padding:5px;
max-height:60px;
background-color:#292929;
}
And this is the Javascript code:
$(".rp, .r2").dotdotdot();
I get informations from an external page, everything worked before, but now it does not.
This is what I get on my site:
Everything is correct but it's not working...
P.S. Sorry about bad formatting
when you call dotdotdot() it is to early stage to calculate domElements. I wired thing to a button click and it is working.
http://jsfiddle.net/6HKJZ/5/
I don't know when you call it exactly but try jquery dom ready event
$(function(){
//Your code
});
if this does not work try to call it little bit later with a setTimeout
AS I understand it you are trying to use a jQuery plugin that adds the method "dotdotdot". Your fiddle only includes jQuery, not the dotdotdot library.
If you check your console, running your project, does it give an "undefined" on the line it runs "dotdotdot"? It does on the fiddle.
I included the lib on this updated fiddle: http://jsfiddle.net/6HKJZ/4/. And it works.
$(".rp, .r2").dotdotdot();

Problems with original Jquery script, it won't start!

I'm suck a noob when it comes to java/jquery, I don't even know the basics. So please have understanding.
I've fetched this script from the jQuery website, but it won't start for me :/
What am I doing wrong?
The whole script is found on http://jsfiddle.net/xZUue/
Thank you for your help!
You have to call the miniscroller function on your div, like so:
$(function() {
$("#scroller").miniscroller();
});
see http://jsfiddle.net/qJkdy/
jQuery is loaded and so is the plugin, but your not making any use of it!
Do:
$('#scroller').miniscroller();
Check out..Its working...u were missing
<script>
$(function () {
$("#scroller").miniscroller();
});
</script>
updated link: http://jsfiddle.net/xZUue/5/

Combining jQuery and Pixastic

I just want to click on the image and then see it blur out. That's it. Here is the link:
http://www.olliemccarthy.com/test/blur-experiment/
Here is the code I've been using so far.
$(document).ready(function() {
$('.test').click(function() {
$(this).("blurfast", {amount:0.8})
});
});
I've tried rearranging the order in which the scripts are called in and no luck.
$(this).pixastic("blurfast", {amount:0.8});
will do it. You forgot to call the jQuery method.
Here is the code I've been using so far.
[snip]
$(this).("blurfast", {amount:0.8})
That's invalid JavaScript syntax and should be throwing a parsing error.
According to the Pixtastic documentation, you want:
$(this).pixastic("blurfast", {amount:0.8});
...assuming that you want to blur the image that was clicked.

Categories