Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
How to create a 3d image that is blinking?
Solved! Go to Solution.
You would probably need to use an $interval timer for this, along these lines:
$scope.blinkInterval = 0;
$scope.blinkImage = function(id) {
var current = $scope.view.wdg[id].visible;
if (current == undefined) { current = true;}
$scope.setWidgetProp(id, "visible", !current);
}
$scope.startBlink = function() {
$scope.blinkInterval = $interval($scope.blinkImage, 1000, 0, true, "3DImage-1");
}
$scope.stopBlink = function(id) {
$interval.cancel($scope.blinkInterval);
}
angular.element(document).ready($scope.startBlink);
You can use the $scope.stopBlink() function to stop the image from blinking, either in response to an event or attached to a UI control if you want.
If you want to control when the blinking starts, simply remove the last line and add a call to $scope.startBlink() when you want it to start blinking.
You would probably need to use an $interval timer for this, along these lines:
$scope.blinkInterval = 0;
$scope.blinkImage = function(id) {
var current = $scope.view.wdg[id].visible;
if (current == undefined) { current = true;}
$scope.setWidgetProp(id, "visible", !current);
}
$scope.startBlink = function() {
$scope.blinkInterval = $interval($scope.blinkImage, 1000, 0, true, "3DImage-1");
}
$scope.stopBlink = function(id) {
$interval.cancel($scope.blinkInterval);
}
angular.element(document).ready($scope.startBlink);
You can use the $scope.stopBlink() function to stop the image from blinking, either in response to an event or attached to a UI control if you want.
If you want to control when the blinking starts, simply remove the last line and add a call to $scope.startBlink() when you want it to start blinking.