I am having some issues with JQuery and CakePHP. I wanted to know if JQuery will work the same way if I have 2 files that call the following function:
$(document).ready(function() {
I have a Featured Content Slider that uses JQuery to Switch contents in a slider, but when I try to create another JQuery file, it does not work. Not even a simple alert.
Is that what is happening or is it something totally different, that perhaps I am overlooking?
Based on the fact that the Slider works, I have to believe I am including the JQuery file correctly. What am I doing wrong?
Thanks,
Yes, that is fine. jQuery will fire all the ready() functions at the same time with no issue. The issue you is in how you're including it not the number of functions.
post some cakephp code and i'll see if I can help
Related
I followed draft-js document to create a very simple demo of draft-js.
Everything seems work well, but when I open the url in Chrome, I can only see a white blank page (there is a hidden editor component there but is not visible)
There is no error on the console of the browser.
The demo project is here: https://github.com/js-demos/react-draft-js-demo, you can clone it and follow the readme to run it.
I have reviewed the code very carefully, but can't figure out why.
If you just use the sample code on the official website of Draft.js, you will see nothing on the page. It's just a blank text input field. If you click that field, you could type something. Draft.js is not a out of the box plugin, but a "a framework for building rich text editors in React".
Hope you figured it out, if not (or for anyone else), the solution for me was two step:
Download the Draft.css file and include it in your source code.
Reference said file in your index.html as such:
<link rel="stylesheet" href="./src/components/Draft.css" />
In other words, your problem was to do with the styling of the Draft-js Editor, since for you the editor was 'hidden' i.e. without any discernible box around it etc.
Actually, I tried a lot to solve this problem but in vain. What I did is using another package that is built on the top of draft js, and It's working fine.
you can find it here:https://jpuri.github.io/react-draft-wysiwyg/#/
I'm no genius, but might I recommend this:
https://www.youtube.com/watch?v=XGxdCXyMC7k
In short, it looks like the default is just a Rich Text Editor enabler type thing. You want more of a single instance, like their demo in the 'Rich Styling' section of the docs.
Is there an equivalent directive for angular thats similar to collection-repeat for ionic? I'm looking for ways to do infinite scroll without taking too much of the dom. Tried the ngInfiniteScroll and the angular ui/ui-scroll.
Are you looking for directives that handle very large collections with decent performance?
I think what you're looking for is called Virtual Scroll. There are a few libraries that do it. I haven't used any yet, but check out angular-virtual-scroll or angular-vs-repeat.
I've got some nested directives inside ng-repeats, they consist of directive that got ng-repeat.
It renders very ugly.
I want to show the content when its finished drawing.
Ive tried to use directives events things like scope.$last, or timeouts but the problem is these elements are created but the browser havent rendered them yet. How to deal with that?
no wonder, you ran into the same problem as me, it's caused by AngularJS dirt checking, it's a cost you using it, but there is not official solution to it yet, there is link has a temp solution you can use, please check on http://tech.small-improvements.com/2013/09/10/angularjs-performance-with-large-lists/ hope this helps!
I've seen http://codef0rmer.github.io/angular-dragdrop/#/list, but this requires jQuery and jQuery UI. If possible, I'd like to not have those dependencies.
The AngularJS documentation SURPRISINGLY has an example of this on the Compiler page. Check it out. You may have to add to it, but it is a great simple example of how to write a directive to get the draggable functionality.
Yes, ngDraggable is designed to support drag-drop functionality without dependency of jQuery UI.
I did some spike and it worked well on PC browsers, however, it still has some UI issues on mobile so far. Here is a live demo.
I'm new to angular and been following the basic tutorials from their official site but I haven't see any tutorial about animating specifically view transition animations. What I want for example is for my current view to pan to the right to show the next view and hitting the back button pans to the left to reveal the previous view.
Does angular.js supports this out of the box? If it does, what is the proper or recommended way of doing it? Thanks a lot.
Angular 1.1.4, released just last night (4/3/2013) supports CSS animation. Though the documentation and examples are still a little scarce, you'll find a good introduction in this video presentation.
Angular doesn't provide animations (or much DOM manipulation at all, really) - those would have to be provided by a 3rd party (probably JQuery).
Since you're new to Angular I'd try to write the animations in a non-angular app, get them working, and then read up on Directives to integrate your work into your Angular app.
Full Tutorials here: http://www.yearofmoo.com/2013/08/remastered-animation-in-angularjs-1-2.html
Things has changed a little bit since 1.1.4