|
I have a code that works, but I need to find another way of writing the JS. The code has 1 image, but 4 mp3 for sounds. There are different dots on the image that when you click on the dots should be a different sound.
html part:
<html>
<head>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<title>OdysseyWare</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="" ie="8">
<link href="/globmedia/ow/css/main_2012_12_12.css" rel="stylesheet">
<link href="/globmedia/ow/css/curric_2012_12_12.css" rel="stylesheet" type="text/css" media="screen">
<link href="/globmedia/lib/jquery-ui/css/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css">
<link href="/globmedia/lib/jquery/css/magnific-popup.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/globmedia/lib/jquery/js/jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript" src="/globmedia/lib/jquery-ui/js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
<script type="text/javascript" src="/globmedia/lib/requirejs/js/require.js" type="text/javascript"></script>
</head>
<body id="body">
<div id="section_0" style="margin: 0px auto; width: 970px">
<div class="presentation">
<presentation>
<div class="section">
<h3>Test 1 New</h3></div>
<p>However, the introduction and conclusion to "The Way to Wealth" show that the author’s
advice is presented in a somewhat ironic way. While the crowd that has gathered to listen to
Father Abraham agrees with him until the "vendue," or sale, begins, they forget the old man’s
and begin to "buy extravagantly."</p>
<p style="TEXT-ALIGN: center">
<div id="test1" data-asset-basepath="media/html5" data-data-basepath="media/html5" data-media-basepath="/globmedia" data-am-controller="media/html5/test1/js/test1.js" style="border: 1px solid black; margin-right: auto; margin-left: auto;"></div>
</p>
</div>
</presentation>
</div>
</div>
<script type="text/javascript">
require.config({
baseUrl:'/globmedia'
});
</script>
<script type="text/javascript" src="/globmedia/html5/animationmanager/js/animationmanager.js"></script>
</body>
</html>
js part
(function(doc){
'use strict';
return function init(){
var _this = this;
require(['createjs','SimpleInteractiveAnimationModule', 'jquery'],function(c, _anm, jq){
var queue = [{id:_this.id + 'audio1',src: _this.assetBasePath + '/test1/media/roles-1_olderMen.mp3', type:'audio'},
{id:_this.id + 'audio2',src: _this.assetBasePath + '/test1/media/roles-1_youngMen.mp3', type:'audio'},
{id:_this.id + 'audio3',src: _this.assetBasePath + '/test1/media/roles-2_olderWomen.mp3', type:'audio'},
{id:_this.id + 'audio4',src: _this.assetBasePath + '/test1/media/roles-2_youngWomen.mp3', type:'audio'},
{id:_this.id + 'image1',src: _this.assetBasePath + '/test1/media/roles.png', type:'image'}];
var pointsNum = 4,
pointsArray = [],
pointColor = '#0040ff';
var pointsObject = {
point1:{
x:382,
y:102},
point2:{
x:146,
y:172},
point3:{
x:455,
y:102},
point4:{
x:312,
y:245},
};
var anm = _anm.getNewInstance();
anm.createSimpleInteraction({parentContainer:_this.element,
queue:queue,
copyright:'2009',
callback:setupClickPoints});
function setupClickPoints(){
for(var i = 0; i < pointsNum; i++)
{
var tempNum = i + 1;
var clickPointShape = new c.Shape();
clickPointShape.graphics.beginFill(pointColor).drawCircle(0,0,16).endFill();
var clickPoint = anm.createSimpleButton(clickPointShape, getClickPoint(i));
anm.updateContainer(clickPoint,{x:pointsObject['point' + tempNum].x,
y:pointsObject['point' + tempNum].y,
alpha:0.01});
pointsArray.push(clickPoint);
}
}
function getClickPoint(audioIndex){
return function(event){
anm.playAudio(audioIndex);
};
}
});
};
}(document));
I just need a different JS code.
Thank you
|
|
|
|
|
|
I using devextreme to develop mobile apps to call my web method wrote in c#. It is success call the web method but the data return is all html source code. I has enable the cross origin in the IIS for the web service.
Below is the jquery get i use to call the web method.
$.get('http://192.168.2.104:81/TwinCatWebServices.aspx/writetempo2', {
btempo2: "'" + viewModel.btempo + "'" }).done(function (result) {
//result is your data
alert("success");
console.log(result);
})
.error(function (result) {
alert(result);
console.log(result);
})
my web method as below
[WebMethod]
public static string writetempo2(string btempo2)
{
string test = "ABC";
return test;
}
I try this as well but also the same
[WebMethod]
public static string writetempo2(string btempo2)
{
string test = "ABC";
var oseries = new System.Web.Script.Serialization.JavaScriptSerializer();
return oseries.Serialize(test);
}
In the browser console, i saw the return result as below:
<title>
AAAAAA
What the mistake I make. Please help.
|
|
|
|
|
Greetings Experts,
I have the following javascript:
<script type="text/javascript">
$(document).ready(function () {
$(
buttonImage:
buttonImageOnly: true, onSelect: function (dateText, inst) {
//Calculate the days here
var days = ($("#txtToDate").datepicker(
//Assign it to textbox
$(
},
onClose: function () { $(this).focus(); }
});
$(
buttonImage:
buttonImageOnly: true, onSelect:
function (dateText, inst) {
$(
}
,
onClose: function () { $(this).focus(); }
});
});
</script>
<script type='text/javascript'>//<![CDATA[
$(window).load(function () {
//Attach click event to button
$(
//Get Values from dropdownlist
var sHour = $(
eHour = $(
//create date format from dropdownlist selected values
var timeStart = new Date(txtFromDate + sHour).getHours();
var timeEnd = new Date(txtToDate + eHour).getHours();
//Calulate the time difference
var hourDiff = timeEnd - timeStart;
//Check if hour difference is less than or equal to 2 hours and show the message accordingly
if (hourDiff <= 2) {
alert("A mininum of 2 hours per reservation is required!");
}
});
});//]]>
</script>
<asp:TextBox ID="txtFromDate" class="fptextbox12" placeholder="MM/DD/YYYY" runat="server" style="width:160px;"></asp:TextBox>
<asp:TextBox ID="txtToDate" class="fptextbox12" placeholder="MM/DD/YYYY" runat="server" style="width:160px;"></asp:TextBox>
The top part of Javascript is used for our datepicker functionality.
A user selects a startdate and an enddate and the total number of days between the startdate and enddate are stored in a control ID called numOfDays.
This works fine.
The second part of the javascript is where I am having issues.
A user selects start time and end time.
If the difference between starttime and endtime is not up to atleast 2 hours, the user is notified that a minimum of two hours is required.
The issue is that I am trying to store the value of startDate and endDate in the two lines below and append time to them but this not working:
var timeStart = new Date(txtFromDate + sHour).getHours();
var timeEnd = new Date(txtToDate + eHour).getHours();
Any ideas what I am doing wrong?
|
|
|
|
|
Hi, samflex, you check if the values
var timeStart = new Date(txtFromDate + sHour).getHours();
var timeEnd = new Date(txtToDate + eHour).getHours();
have the correct value?? Futhermore you need be carefully with the behavior of dropdownlist
Regarts
|
|
|
|
|
Hi Pablo,
Thanks for the prompt response.
What you just posted is what I have though. What am I missing?
Just to explain further, when you select a date value from the datepicker, say for instance, the FromDate, it goes into the control below:
<asp:TextBox ID="txtToDate" class="fptextbox12" placeholder="MM/DD/YYYY" runat="server" style="width:160px;"></asp:TextBox>
What I am trying to do is grab that value and stick it into this:
var timeStart = new Date(txtFromDate + sHour).getHours()
This way, if I select start time of 12:00PM, it should show something like:
06/24/2014 12:00PM.
Same goes with txtToDate. Am I not doing it correctly?
|
|
|
|
|
Hi Samflex, probably you need to use other method to obtain the correct time. JS have a little tricks with the dates and it is a little confused.
Is better than you check this page
http://www.w3schools.com/js/js_dates.asp[^]
that have a lot of information about that.
With the few details that I can see, me mainly suppose that your problem is the format. So please check the page for more information
Regarts.
PD: If need more help, feel free to ask.
|
|
|
|
|
|
In GridView, one column is of checkboxes, I need that if any duplicate record is there for e.g. Name is duplicate and we check its checkbox then record of its duplicate name should also get checked.
|
|
|
|
|
Hi,
Lets assume that you want to do on Name so if check one checkbox with Name Ravi and there are 3 record with Name Ravi then all 3 checkbox should get checked,
so you can do like below, lets say that you are having checkboxes
<div id="mainGridDiv">
<input type="checkbox" value="<Name>"/>
<input type="checkbox" value="<Name>"/>
<input type="checkbox" value="<Name>"/>
</div>
JQuery Code
$("#mainGridDiv input[type=checkbox]").change(function(){
var currValue = $(this).val();
$("#mainGridDiv input[type=checkbox]").find("[value='"+currValue+"']").attr("checked",$(this).checked)
});
NOTE:Assuming checkbox is one column of your grid.
Thanks
Raviranjan
|
|
|
|
|
Hello,
I am using regex to validate some patterns in javascript
My pattern is
[VF][0-9]
And required output is V1-V9 , F1-F9 in any order (eg:V1,V3,V2,F1,F5,F3) OR (eg: F1,F5,F3,V1,V3,V2)
But it is not working can any one help me?
Thanks and regards.
|
|
|
|
|
You question is not clear. The regex provided will check if the string has an V or F (case sensitive) at the first position and then a digit (0-9).
But the part of the 'required output' is confusing! What the input, what the output, what have you expected?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Hello,
My input is something like V1V2-V3-S-V4-F1
And I need to validate the given value contain any of V1 to V9 or F1 to F9 and S.
eg: if user input V20V30-V12-S10-V20-F10 I have to show a error because only 1-9 is allowed.
eg2: if user input R1R2-R3-S-R5-T6 I have to show a error because only V,S,F allowed
And it is not mandatory to enter V/F but S is mandatory.
I think it is clear now.
|
|
|
|
|
|
You need the pattern "[VF][1-9]-?$"
Because V20 matchs [VF][1-9] as V2
Hope this will help you.
|
|
|
|
|
when i use this code it doesnt work correctly :
<script type="text/javascript" src="includes/mootools.js"></script>
<script type="text/javascript" src="includes/ja_contentslide.js"></script>
<script>
jQuery.noConflict();
//(function( $ ) {
// Your jQuery code here, using the $
//})( jQuery );
</script>
<script type="text/javascript" src="slidshow/modernizr.js"></script>
<script type="text/javascript" src="slidshow/jquery_004.js"></script>
<script type="text/javascript" src="slidshow/jquery_006.js"></script>
|
|
|
|
|
Member 9473809 wrote: doesnt work correctly It's a bit confusing. What does not work? There is an error? No error but the outcome is different from what you have expected?
In any way - from the piece of code here it seems that you use jQuery before including it!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
function GetEqrDataUploadFiles()
{
var upload=$("#files").data("KendoUpload");
var s = upload.wrapper[0].childNodes[2].childNodes.length;
var a = new Array();
for (i = 0; i < s; i++)
{
if (document.all) {
a.push(upload.wrapper[0].childNodes[2].childNodes[i].innerText);
}
else {
a.push(upload.wrapper[0].childNodes[2].childNodes[i].textContent);
}
}
return a;
}
|
|
|
|
|
This means that upload.wrapper[0] is null. You'll need to debug it to figure out why.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
javascript Run Time Error[^]
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Hi,
From where you are calling function GetEqrDataUploadFiles(), can you try to call function GetEqrDataUploadFiles() from inside document.ready function if you are not?
Thanks
Raviranjan
|
|
|
|
|
check the result of the follow code:
alert(upload.wrapper && upload.wrapper.length);
|
|
|
|
|
Hi,
I am new to javascript. How to increment the margin left value using javascript while mouseover time.
NalluJi
|
|
|
|
|
|
In what way is a switch more efficient than an if statment?
|
|
|
|
|