+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / Getting a JS Scroller to work

Getting a JS Scroller to work

10 posts, 0 answered
  1. Dennis
    Dennis avatar
    16 posts
    Registered:
    10 Aug 2012
    16 Feb 2010
    Link to this post
    Hi, I needed to add a JS scroller to this page http://www.dyrbergkern.co.nz/Stockists.aspx but although I could get the page to work on my local machine when I pasted the html into a generic content on the page and added the  ../UserControls/Scroller/jsScroller.js link in the 'Add Head tags' area it didn't work.

    My web designer also tried to create a custom contol in the page http://www.dyrbergkern.co.nz/scrollerTrial.aspx to for the scroller but that also didn't work.

    It is a very simple thing we are trying to do and it should be just a matter of adding the correct DIVs and pointing to the correct JS file. However, this has become very frustrating so can anyone help?

    Cheers
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    17 Feb 2010
    Link to this post
    So you just need to add the script to a page?

    Why not use this marketplace control?
    http://www.sitefinity.com/marketplace/modules/js-include-user-control.aspx
  3. Dennis
    Dennis avatar
    16 posts
    Registered:
    10 Aug 2012
    17 Feb 2010
    Link to this post
    Hi Steve,

    Thanks heaps for that. That should work very well in the custom control and the developer used it but still hasn't worked.

    However, I was trying to attach the JS to a Sitefinity generated page and manually adding the div with specific ID in a standard generic content.

    So I would still like to know why the approach I used didn't work. I thought we followed the correct method and the swfobject JS works fine so JS is enabled in the generic content controls. However swfobject doesn't need to load anything in the head so that is where the problem is.

    As a novice to Sitefinity it can be a big learning curve when needed use alternitive approaches to simple tasks.

    Cheers
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Feb 2010
    Link to this post
    Hi Dennis,

    I checked the js code you use and there is not problem with it and its integration in Stiefinity with GenericContent control. Most probably something with the setup is not correct, because I prepared a sample that works without problems at  my end. I suggest that you should check "Preparation" notes.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Dennis
    Dennis avatar
    16 posts
    Registered:
    10 Aug 2012
    22 Feb 2010
    Link to this post
    Thanks Ivan for your help. The developer has revisited the instilation notes and I also checked it out. I managed to get it working easily on my local system but I don't have Sitefinity installed (I'm not a developer). I am now concerned if there was something amiss when the sitefinity site was uploaded. The site is on a shared hosing server and managed by HSphere and I know there are certian issues with shared servers but I can't see that being a problem with such a simple script like this and we have never had JS issues before.
  6. Jason
    Jason avatar
    23 posts
    Registered:
    17 Jun 2009
    23 Feb 2010
    Link to this post
    Hi

    I'm the developer working on this project.  I thought i would explain the situation a bit more...

    The JavaScript was added to the control using the jsInclude control found in the marketplace.  It works perfectly on my local system however not on the server.  I also tested it on another site but got the same results - it didn't work.  On the other site i have some javascript controlling the click event of some images.  I first included the jsInclude to the images but when that didn't work i simply added the javascript to the master page and it worked.

    I think that i will have to do the same with this site (http://www.dyrbergkern.co.nz/Stockists.aspx) however it would be interesting to hear thoughts on why the jsInclude worked locally but not on the server.  Could it be something on the server preventing it?

    Cheers
    Jason
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Feb 2010
    Link to this post
    Hi Jason,

    Adding the code to the master page is not a good solution. You can create a basic simple control that will register the script only on a certain page.

    HtmlGenericControl scriptControl = new HtmlGenericControl("script");
    scriptControl.Attributes.Add("type", "text/javascript");
    scriptControl.Attributes.Add("src", UrlSrc);
    this.Page.Header.Controls.Add(scriptControl);

    It seems that you are using iframe on http://www.dyrbergkern.co.nz/scrollerTrial.aspx and inside this  iframe you are calling the script which could be the problem.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Dennis
    Dennis avatar
    16 posts
    Registered:
    10 Aug 2012
    23 Feb 2010
    Link to this post
    Hi, thanks Jason. I hope someone will shine some light onto this problem.

    I just thougth I would mention that I needed to edit the page http://www.dyrbergkern.co.nz/Stockists.aspx so that we cold get some sort of slider control by simply setting "overflow:auto;" in the CSS. The enabled some functionality in that page. The page  http://www.dyrbergkern.co.nz/Stockists_copy1.aspx is still functioning with the JS problem and the original formatted CSS.
  9. Dennis
    Dennis avatar
    16 posts
    Registered:
    10 Aug 2012
    23 Feb 2010
    Link to this post
    Sorry, Ivan, that way my fault. I uploaded the new CSS before your last view and thats why it looks like an iframe (but it is just CSS). http://www.dyrbergkern.co.nz/Stockists_copy1.aspx  still has the JS problem (and origianl CSS) but maybe your sugestion and code might help us out.
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Feb 2010
    Link to this post
    Hi Dennis,

    The problem does not seem to be css related. Most probably you  have a problem with the js code or its initialization.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
10 posts, 0 answered